Bug 24239

Summary: rc.conf ipv6 missing options
Product: Base System Reporter: Leo Bicknell <bicknell>
Component: confAssignee: Hajimu UMEMOTO <ume>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   

Description Leo Bicknell 2001-01-11 02:30:00 UTC
	In /etc/rc.conf is documented the manual configuration for
IPv6:

#ipv6_ifconfig_ed0="fec0:0:0:5::1 prefixlen 64" # Sample alias entry

	Unfortunately, this does not allow you to configure multiple
aliases, like the IPv4 code does.  The code should also support 
variables like:

#ipv6_ifconfig_ed0_alias0="fec0:0:0:5::2 prefixlen 64" # Sample alias entry
#ipv6_ifconfig_ed0_alias1="fec0:0:0:5::3 prefixlen 64" # Sample alias entry

	And so on.

Fix: 

Borrowing from the code that is in /etc/rc.network (v4) to 
create a v6 example I recomend replacing this v6 code in /etc/rc.network6:

network6_interface_setup() {                                                              
[snip]                                                                                    
        for i in $ipv6_network_interfaces; do                 
[snip]                                                            
                eval ipv6_ifconfig=\$ipv6_ifconfig_$i                   
                if [ -n "${ipv6_ifconfig}" ]; then          
                        rtsol_available=no                        
                        rtsol_interface=no                              
                        ifconfig $i inet6 ${ipv6_ifconfig} alias  
                fi                                                

	With something more along these lines:

                # Check to see if aliases need to be added                
                #                                                         
                alias=0                                                   
                while : ; do                                              
                        eval ifconfig_args=\$ipv6_ifconfig_${ifn}_alias${alias}
                        if [ -n "${ifconfig_args}" ]; then                                
                                if [ -n "${ipv6_ifconfig}" ]; then                        
                                       rtsol_available=no                                 
                                       rtsol_interface=no                                 
                                       ifconfig ${ifn} inet6 ${ifconfig_args} alias       
                                       alias=`expr ${alias} + 1`                          
                                fi                                                        
                        else                                                       
                                break;                                             
                        fi                                                         
                done                                                               


	I'm not sure I'm doing the right things with the "rtsol_available"
and "rtsol_interface", or that there aren't other things that should be
done, so consider this an example only.
How-To-Repeat: 
	Not really anything to repeat, now is there. :-)
Comment 1 Hajimu UMEMOTO freebsd_committer freebsd_triage 2001-03-17 17:00:52 UTC
Responsible Changed
From-To: freebsd-bugs->ume

I'll support it later.
Comment 2 Hajimu UMEMOTO freebsd_committer freebsd_triage 2001-03-18 16:08:01 UTC
State Changed
From-To: open->closed

Thanks!  I just committed it.