From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 18 22:52:55 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1D5839A for ; Fri, 18 Jul 2014 22:52:55 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2FF82894 for ; Fri, 18 Jul 2014 22:52:55 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IMqtVM024147 for ; Fri, 18 Jul 2014 22:52:55 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 191961] New: [regression] network.subr fails to assign vlan aliases Date: Fri, 18 Jul 2014 22:52:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 9.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ben@b1c1l1.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 22:52:56 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191961 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@FreeBSD.org Reporter: ben@b1c1l1.com Assigning aliases to vlan interfaces in /etc/rc.conf no longer works in 9.3-RELEASE. The following script demonstrates the problem: #!/bin/sh . /etc/rc.subr . /etc/network.subr IFCONFIG_CMD="/bin/echo ${IFCONFIG_CMD}" ifconfig_em0_1_alias0="inet 10.0.16.16/32" ifconfig_em0_1_alias1="inet 10.0.16.18/32" ifconfig_em0_1_alias2="inet 10.0.16.20/32" 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 10.0.16.16/32 alias /sbin/ifconfig em0_1 inet 10.0.16.18/32 alias /sbin/ifconfig em0_1 inet 10.0.16.20/32 alias The correct output when run on 9.2-RELEASE: /sbin/ifconfig em0.1 inet 10.0.16.16/32 alias /sbin/ifconfig em0.1 inet 10.0.16.18/32 alias /sbin/ifconfig em0.1 inet 10.0.16.20/32 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 @@ _af=$2 _action=$3 - # 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))` do eval ifconfig_args=\"\$$alias\" @@ -1053,7 +1051,8 @@ # backward compatibility: ipv6_ifconfig_IF_aliasN. case $_af in inet6) - 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))` do eval ifconfig_args=\"\$$alias\" -- You are receiving this mail because: You are the assignee for the bug.