From owner-svn-src-head@FreeBSD.ORG Tue Jun 24 04:37:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0646E681; Tue, 24 Jun 2014 04:37:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C192ACE; Tue, 24 Jun 2014 04:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O4baBd064857; Tue, 24 Jun 2014 04:37:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O4baoe064856; Tue, 24 Jun 2014 04:37:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201406240437.s5O4baoe064856@svn.freebsd.org> From: Hiroki Sato Date: Tue, 24 Jun 2014 04:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267812 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 04:37:37 -0000 Author: hrs Date: Tue Jun 24 04:37:36 2014 New Revision: 267812 URL: http://svnweb.freebsd.org/changeset/base/267812 Log: Fix ifname normalization. ifconfig_IF_alias{es,N} did not work if ifname has any of [.-/+]. Spotted by: jhay Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Tue Jun 24 02:02:51 2014 (r267811) +++ head/etc/network.subr Tue Jun 24 04:37:36 2014 (r267812) @@ -1077,7 +1077,7 @@ ifalias_af_common_handler() ifalias_af_common() { local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf - local _punct=".-/+" + local _vif _punct=".-/+" _ret=1 _aliasn= @@ -1086,11 +1086,11 @@ ifalias_af_common() _action=$3 # Normalize $_if before using it in a pattern to list_vars() - ltr "$_if" "$_punct" "_" _if + ltr "$_if" "$_punct" "_" _vif # ifconfig_IF_aliasN which starts with $_af - for alias in `list_vars ifconfig_${_if}_alias[0-9]\* | - sort_lite -nk1.$((9+${#_if}+7))` + for alias in `list_vars ifconfig_${_vif}_alias[0-9]\* | + sort_lite -nk1.$((9+${#_vif}+7))` do eval ifconfig_args=\"\$$alias\" _iaf= @@ -1118,8 +1118,8 @@ ifalias_af_common() # backward compatibility: ipv6_ifconfig_IF_aliasN. case $_af in inet6) - for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* | - sort_lite -nk1.$((14+${#_if}+7))` + for alias in `list_vars ipv6_ifconfig_${_vif}_alias[0-9]\* | + sort_lite -nk1.$((14+${#_vif}+7))` do eval ifconfig_args=\"\$$alias\" case ${_action}:"${ifconfig_args}" in @@ -1129,7 +1129,7 @@ ifalias_af_common() alias:*) _aliasn="${_aliasn} inet6 ${ifconfig_args}" warn "\$${alias} is obsolete. " \ - "Use ifconfig_$1_aliasN instead." + "Use ifconfig_${_vif}_aliasN instead." ;; esac done