From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 28 20:05:09 2007 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5316E16A401; Sun, 28 Jan 2007 20:05:09 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from postfix2-g20.free.fr (postfix2-g20.free.fr [212.27.60.43]) by mx1.freebsd.org (Postfix) with ESMTP id 83CF613C461; Sun, 28 Jan 2007 20:05:08 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from smtp7-g19.free.fr (smtp7-g19.free.fr [212.27.42.64]) by postfix2-g20.free.fr (Postfix) with ESMTP id 17A409A9BDE; Sun, 28 Jan 2007 19:40:29 +0100 (CET) Received: from smtp.xbsd.org (unknown [82.233.2.192]) by smtp7-g19.free.fr (Postfix) with ESMTP id CFD225600; Sun, 28 Jan 2007 20:40:20 +0100 (CET) Received: from localhost (localhost.xbsd.org [127.0.0.1]) by smtp.xbsd.org (Postfix) with ESMTP id 30F7011806; Sun, 28 Jan 2007 20:40:20 +0100 (CET) X-Virus-Scanned: amavisd-new at xbsd.org Received: from smtp.xbsd.org ([127.0.0.1]) by localhost (srv1.xbsd.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xmDWBq15BsrJ; Sun, 28 Jan 2007 20:40:13 +0100 (CET) Received: from [193.120.13.130] (cream.xbsd.org [193.120.13.130]) by smtp.xbsd.org (Postfix) with ESMTP id A35AF1164F; Sun, 28 Jan 2007 20:40:12 +0100 (CET) Message-ID: <45BCFB5F.2040509@FreeBSD.org> Date: Sun, 28 Jan 2007 19:37:03 +0000 From: Florent Thoumie User-Agent: Thunderbird 1.5.0.9 (X11/20070122) MIME-Version: 1.0 To: Norikatsu Shigemura References: <20061029010934.5afef73e.nork@FreeBSD.org> <200610281610.k9SGAIVb051055@freefall.freebsd.org> <20070129000459.b2dba4e0.nork@FreeBSD.org> In-Reply-To: <20070129000459.b2dba4e0.nork@FreeBSD.org> X-Enigmail-Version: 0.94.1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigB3FDFFC9949431DB83FAF0B7" Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 20:05:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB3FDFFC9949431DB83FAF0B7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Norikatsu Shigemura wrote: > On Sat, 28 Oct 2006 16:10:18 GMT > FreeBSD-gnats-submit@FreeBSD.org wrote: >> Thank you very much for your problem report. >> It has the internal identification `conf/104884'. >> The individual assigned to look at your >> report is: freebsd-bugs.=20 >> You can access the state of your problem report at any time >> via this link: >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D104884 >>> Category: conf >>> Responsible: freebsd-bugs >>> Synopsis: Add support EtherChannel configuration to rc.conf >>> Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 >=20 > I chased HEAD. Please see following patch. > Anyone, please handle this PR? > And I'll make a patch for 6-stable. I'm sorry, I meant to answer but forgot about it. I don't know much about technical details, so I'll only focus on style. Here are my comments on the patch: > Index: network.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/etc/network.subr,v > retrieving revision 1.176 > diff -u -r1.176 network.subr > --- network.subr 29 Oct 2006 13:29:49 -0000 1.176 > +++ network.subr 28 Jan 2007 14:52:36 -0000 > @@ -907,3 +907,78 @@ > esac > done > } > + > +ng_mkpeer() { > + ngctl -f - 2> /dev/null < +mkpeer $* > +msg dummy nodeinfo > +EOF > +} > + > +ng_create_one() { > + ng_mkpeer $* | while read line; do > + t=3D`expr "${line}" : '.* name=3D"\([a-z]*[0-9]*\)" .*'` > + if [ -n "${t}" ]; then > + echo ${t} > + return > + fi > + done > +} > + > +ng_fec_create() { > + local req_iface iface bogus > + req_iface=3D"$1" > + > + if [ -z "${req_iface}" ]; then Why are you testing this? It's only called in fec_up() and can't be called with a empty argument. Or do you want to "export" the function to other scripts? > + iface=3D`ng_create_one fec dummy fec` > + if [ -z "${iface}" ]; then > + exit 2 > + fi > + echo ${iface} > + return > + fi > + > + ngctl shutdown ${req_iface}: > /dev/null 2>&1 > + > + bogus=3D"" > + while true; do > + iface=3D`ng_create_one fec dummy fec` > + if [ -z "${iface}" ]; then > + exit 2 > + fi > + if [ "${iface}" =3D "${req_iface}" ]; then > + echo ${iface} > + break > + fi > + bogus=3D"${bogus} ${iface}" > + done > + > + for iface in ${bogus}; do > + ngctl shutdown ${iface}: > + done These loops are a bit confusing. If I understand correctly, you're creating interfaces until they reach the right number and then you delete all the ones which have been created unnecessarily? Could it be that iface is higher than req_iface (which would loop undefinitely)? > +} > + > +# fec_up ifn > +# Configure Fast EtherChannel for interface $ifn. Returns 0 if FEC > +# arguments were found and configured; returns 1 otherwise. > +fec_up() { > + case ${fec_interfaces} in > + [Nn][Oo] | '') > + ;; What's the point of this? The 'case' seems useless to me. Just got with the 'for' loop. If it's an empty list, then it just won't do anything. Default has to be '' and not 'NO' (but it seems more sensible anyway). > + *) > + for i in ${fec_interfaces}; do > + ng_fec_create $i > + for j in `get_if_var $i fecconfig_IF`; do > + case ${j} in > + '') > + continue > + ;; > + *) > + ngctl msg ${i}: add_iface "\"${j}\"" > + ;; > + esac > + done > + done > + ;; > + esac > +} > Index: defaults/rc.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/etc/defaults/rc.conf,v > retrieving revision 1.303 > diff -u -r1.303 rc.conf > --- defaults/rc.conf 20 Jan 2007 04:24:19 -0000 1.303 > +++ defaults/rc.conf 28 Jan 2007 14:52:36 -0000 > @@ -183,6 +183,10 @@ > # Choose correct tunnel addrs. > #gifconfig_gif0=3D"10.1.1.1 10.1.2.1" # Examples typically for a route= r. > #gifconfig_gif1=3D"10.1.1.2 10.1.2.2" # Examples typically for a route= r. > +fec_interfaces=3D"NO" # List of Fast EtherChannels (or "NO") Set to '' instead of 'NO' as explained above. --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer --------------enigB3FDFFC9949431DB83FAF0B7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFvPtjMxEkbVFH3PQRCrPlAJ9QEPvY37Aig2zecyxSrRrhKd5jhgCffNec i/xPN8NB5u0rAaG6oEanBnA= =u0qe -----END PGP SIGNATURE----- --------------enigB3FDFFC9949431DB83FAF0B7--