Date: Thu, 05 Sep 2013 05:19:41 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: asomers@FreeBSD.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r253924 - in head: etc etc/rc.d share/man/man5 Message-ID: <20130905.051941.1980191753384588454.hrs@allbsd.org> In-Reply-To: <CAOtMX2hjMGUwunYAz77J09edxRW_BCGuy8fbN63SDYdSoui9Lg@mail.gmail.com> References: <201308040636.r746aI5i038931@svn.freebsd.org> <CAOtMX2hjMGUwunYAz77J09edxRW_BCGuy8fbN63SDYdSoui9Lg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Thu_Sep__5_05_19_41_2013_357)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Sep__5_05_19_41_2013_886)--" Content-Transfer-Encoding: 7bit ----Next_Part(Thu_Sep__5_05_19_41_2013_886)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Alan Somers <asomers@freebsd.org> wrote in <CAOtMX2hjMGUwunYAz77J09edxRW_BCGuy8fbN63SDYdSoui9Lg@mail.gmail.com>: as> With this revision, I am unable to down an ipv4 interface using as> "/etc/rc.d/netif stop em1". When I try, ipv4_down cannot find the address as> to delete, because "$_inet" begins with a tab character and the therefore as> it matches the "*)" rule in the case statement. Presumably "$_inet" as> doesn't always begin with a tab, so this patch will match with or without as> the tab. Does it look good to you? as> as> --- /usr/home/alans/freebsd/head/etc/network.subr 2013-08-20 as> 19:33:30.6712 as> 28832 +0000 as> +++ /etc/network.subr 2013-08-22 15:49:53.000000000 +0000 as> @@ -661,16 +668,16 @@ as> for _inet in $inetList ; do as> # get rid of extraneous line as> case $_inet in as> - "") break ;; as> - inet\ *) ;; as> - *) continue ;; as> + "") break ;; as> + \ inet\ *|inet\ *) ;; as> + *) continue ;; as> esac as> [ -z "$_inet" ] && break Sorry for the delay getting back to you. Can you try the attached patch? It includes some other fixes but I think adding \t to tr(1) should be enough to solve the problem. -- Hiroki ----Next_Part(Thu_Sep__5_05_19_41_2013_886)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="network.subr.20130905-1.diff" Index: etc/network.subr =================================================================== --- etc/network.subr (revision 254465) +++ etc/network.subr (working copy) @@ -654,7 +654,7 @@ ifalias ${_if} inet -alias && _ret=0 - inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet ' | tr "\n" "$_ifs"`" + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet ' | tr "\n\t" "$_ifs"`" oldifs="$IFS" IFS="$_ifs" @@ -661,11 +661,9 @@ for _inet in $inetList ; do # get rid of extraneous line case $_inet in - "") break ;; inet\ *) ;; *) continue ;; esac - [ -z "$_inet" ] && break _inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` @@ -696,13 +694,16 @@ ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0 ifalias ${_if} inet6 -alias && _ret=0 - inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`" + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet6 ' | tr "\n\t" "$_ifs"`" oldifs="$IFS" IFS="$_ifs" for _inet6 in $inetList ; do # get rid of extraneous line - [ -z "$_inet6" ] && break + case $_inet in + inet6\ *) ;; + *) continue ;; + esac _inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'` ----Next_Part(Thu_Sep__5_05_19_41_2013_886)---- ----Security_Multipart0(Thu_Sep__5_05_19_41_2013_357)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlInld0ACgkQTyzT2CeTzy2zhgCfdR7QTcGQLIVQbY/1ppAt10Xf 6qoAn3TCX+dLv4j4EWXHAR98tt5cjeq9 =qXbL -----END PGP SIGNATURE----- ----Security_Multipart0(Thu_Sep__5_05_19_41_2013_357)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130905.051941.1980191753384588454.hrs>