conf/163144: There is no way to set nic's alias with both IPv4 and IPv6.

Isami Hanaoka isamihanaoka at gmail.com
Fri Dec 9 07:10:03 UTC 2011


>Number:         163144
>Category:       conf
>Synopsis:       There is no way to set nic's alias with both IPv4 and IPv6.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 09 07:10:02 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Isami Hanaoka
>Release:        9.0-RC2
>Organization:
Heart Solutions
>Environment:
FreeBSD minato.private 9.0-RC2 FreeBSD 9.0-RC2 #0: Sat Nov 12 18:35:25 UTC 2011     root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
In 9.0-RC2, RC3, "network.subr" uses  "ifconfig_IF_aliasN" for alias setting(both IPv4 and IPv6)

The function named "ifalias_ipv4_up" set IPv4's alias and the function named "if
alias_ipv6_up" set IPv6's alias.
However, the alias index number start from 0 in each function.
so there is no way to set nic's alias with both IPv4 and IPv6.
The only way is using backward compatibility method, such as
"ipv6_ifconfig_IF_aliasN".
But this method generate warning.

>How-To-Repeat:
see my rc.conf:

ifconfig_bge0="inet 192.168.252.170 netmask 255.255.255.0"
ifconfig_bge0_alias0="inet 192.168.253.171 netmask 255.255.255.255"
ifconfig_bge0_alias1="inet 192.168.253.172 netmask 255.255.255.255"
ifconfig_bge0_alias2="inet6 2400:XXXX:XXXX:0000::192.168.253.171 prefixlen 64"
ifconfig_bge0_alias3="inet6 2400:XXXX:XXXX:0000::192.168.253.172 prefixlen 64"

The function named "ifalias_ipv6_up" checks ifconfig_bge0_alias0 first, but
no such variables.
so, this function exit immediately and alias2 and alias3 are ignored. 
>Fix:
Simple solution:
ipv4_alias_up ignores inet6 alias and
ipv6_alias_up ignores inet alias.
I dont know the solutions is best or not.


*** /etc/network.subr-  2011-12-09 15:33:47.471197003 +0900
--- /etc/network.subr   2011-12-09 15:34:43.810200121 +0900
***************
*** 707,712 ****
--- 707,714 ----
                inet\ *)
                        ifconfig $1 ${ifconfig_args} alias && _ret=0
                        ;;
+               inet6\ *)
+                       ;;
                "")
                        break
                        ;;
***************
*** 733,738 ****
--- 735,742 ----
                inet6\ *)
                        ifconfig $1 ${ifconfig_args} alias && _ret=0
                        ;;
+               inet\ *)
+                       ;;
                "")
                        break
                        ;;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list