Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2015 10:12:28 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 202215] /etc/network.subr IP aliases broken for vlan subinterfaces
Message-ID:  <bug-202215-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202215

            Bug ID: 202215
           Summary: /etc/network.subr IP aliases broken for vlan
                    subinterfaces
           Product: Base System
           Version: 9.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: conf
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: hhw@pce-net.com

MFC r267812 for normalizing interface names ($_if) with ".+-" in them before
using it in a pattern to list_vars() broke the ability to have aliases on vlan
sub-interfaces by modifying the value of $_if instead of just using the
normalized form for matching.

By using a separate local variable for the matching pattern and leaving the
original value of $_if intact, list_vars can return the appropriate values
without causing issues for configuring the IP aliases themselves. Unified diff
for fix included below:

--- /etc/network.subr.orig      2014-07-10 16:50:15.000000000 -0700
+++ /etc/network.subr   2015-08-10 02:35:39.000000000 -0700
@@ -1010,7 +1010,7 @@
 #
 ifalias_af_common()
 {
-       local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
+       local _ret _if _nif _af _action alias ifconfig_args _aliasn _c _tmpargs
_iaf
        local _punct=".-/+"

        _ret=1
@@ -1020,10 +1020,10 @@
        _action=$3

        # Normalize $_if before using it in a pattern to list_vars()
-       ltr "$_if" "$_punct" "_" _if
+       ltr "$_if" "$_punct" "_" _nif

        # ifconfig_IF_aliasN which starts with $_af
-       for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
+       for alias in `list_vars ifconfig_${_nif}_alias[0-9]\* |
                sort_lite -nk1.$((9+${#_if}+7))`
        do
                eval ifconfig_args=\"\$$alias\"

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202215-8>