[Bug 191961] New: [regression] network.subr fails to assign vlan aliases

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jul 18 22:52:56 UTC 2014


            Bug ID: 191961
           Summary: [regression] network.subr fails to assign vlan aliases
           Product: Base System
           Version: 9.3-RELEASE
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: conf
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: ben at b1c1l1.com

Assigning aliases to vlan interfaces in /etc/rc.conf no longer works in
9.3-RELEASE.  The following script demonstrates the problem:

. /etc/rc.subr
. /etc/network.subr
ifalias_af_common em0.1 inet alias

On 9.3-RELEASE this incorrectly attempts to call ifconfig with "em0_1":

/sbin/ifconfig em0_1 inet alias
/sbin/ifconfig em0_1 inet alias
/sbin/ifconfig em0_1 inet alias

The correct output when run on 9.2-RELEASE:

/sbin/ifconfig em0.1 inet alias
/sbin/ifconfig em0.1 inet alias
/sbin/ifconfig em0.1 inet alias

The relevant commit in stable/9 is r264439 (MFC of r264243).

The original code only normalized (ltr $_if) in subshells so the normalized
value was not exposed to ifalias_af_common_handler().  The following hack fixes
the regression although it should probably be re-factored:

--- /etc/network.subr   2014-07-18 05:33:57.000000000 +0000
+++ network.subr        2014-07-18 22:44:35.000000000 +0000
@@ -1019,11 +1019,9 @@

-       # Normalize $_if before using it in a pattern to list_vars()
-       ltr "$_if" "$_punct" "_" _if
        # ifconfig_IF_aliasN which starts with $_af
-       for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
+       for alias in `ltr "$_if" "$_punct" "_" _if;
+               list_vars ifconfig_${_if}_alias[0-9]\* |
                sort_lite -nk1.$((9+${#_if}+7))`
                eval ifconfig_args=\"\$$alias\"
@@ -1053,7 +1051,8 @@
        # backward compatibility: ipv6_ifconfig_IF_aliasN.
        case $_af in
-               for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
+               for alias in `ltr "$_if" "$_punct" "_" _if;
+                       list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
                        sort_lite -nk1.$((14+${#_if}+7))`
                        eval ifconfig_args=\"\$$alias\"

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list