From owner-freebsd-net@FreeBSD.ORG Thu Jun 19 10:35:16 2014 Return-Path: Delivered-To: freebsd-net@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 2F22F584 for ; Thu, 19 Jun 2014 10:35:16 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id CA01320D6 for ; Thu, 19 Jun 2014 10:35:15 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id 96F90B828; Thu, 19 Jun 2014 12:35:13 +0200 (SAST) Date: Thu, 19 Jun 2014 12:35:13 +0200 From: John Hay To: freebsd-net@freebsd.org Subject: network.subr vlan handling broken Message-ID: <20140619103513.GA92393@zibbi.meraka.csir.co.za> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2014 10:35:16 -0000 Hi Guys, freebsd-rc did not react, so I'm just checking on -net too. I found after upgrading that vlan handling broke. I tried the following: vlans_bce1="6" ipv4_addrs_bce1_6="inet 10.239.100.2/24" ifconfig_bce1_6_aliases="inet 10.239.100.2/24" ifconfig_bce1_6_alias0="inet 10.239.100.2/24" I traced it down to ifalias_af_common_handler being called with the mangled interfcace name _if and it then calls ifconfig with it. Here is my fix. Any reason not to commit it? My diff is against 10-stable, but head looks the same. ################# --- /etc/network.subr.orig 2014-06-01 17:30:38.000000000 +0000 +++ /etc/network.subr 2014-06-01 18:03:08.030175024 +0000 @@ -1151,7 +1151,7 @@ inet|inet6|ipx|link|ether) case $_tmpargs in ${_af}\ *) - eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0 + eval ifalias_af_common_handler $1 $_af $_action $_tmpargs && _ret=0 ;; esac _tmpargs=$_c @@ -1163,7 +1163,7 @@ # Process the last component case $_tmpargs in ${_af}\ *) - ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0 + ifalias_af_common_handler $1 $_af $_action $_tmpargs && _ret=0 ;; esac ################# While looking through the code I saw that ltr is called with different styling. Is there a reason for it? Which is the prefered style? ltr ${_if} "${_punct}" '_' _if ltr "$_if" "$_punct" "_" _if My own preference would be the first. Regards John -- John Hay -- jhay@meraka.csir.co.za / jhay@meraka.org.za