From owner-freebsd-rc@FreeBSD.ORG Sun Jan 28 15:29:54 2007 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35C8E16A401; Sun, 28 Jan 2007 15:29:54 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.freebsd.org (Postfix) with ESMTP id B33C513C461; Sun, 28 Jan 2007 15:29:53 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.8/8.13.8/NinthNine) with SMTP id l0SF4xPV095700; Mon, 29 Jan 2007 00:04:59 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Mon, 29 Jan 2007 00:04:59 +0900 From: Norikatsu Shigemura To: freebsd-rc@FreeBSD.org Message-Id: <20070129000459.b2dba4e0.nork@FreeBSD.org> In-Reply-To: <200610281610.k9SGAIVb051055@freefall.freebsd.org> References: <20061029010934.5afef73e.nork@FreeBSD.org> <200610281610.k9SGAIVb051055@freefall.freebsd.org> X-Mailer: Sylpheed 2.3.0rc (GTK+ 2.10.8; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sakura.ninth-nine.com [219.127.74.121]); Mon, 29 Jan 2007 00:05:00 +0900 (JST) Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 15:29:54 -0000 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. > You can access the state of your problem report at any time > via this link: > http://www.freebsd.org/cgi/query-pr.cgi?pr=104884 > >Category: conf > >Responsible: freebsd-bugs > >Synopsis: Add support EtherChannel configuration to rc.conf > >Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 I chased HEAD. Please see following patch. Anyone, please handle this PR? And I'll make a patch for 6-stable. Index: network.subr =================================================================== 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 < /dev/null 2>&1 + + bogus="" + while true; do + iface=`ng_create_one fec dummy fec` + if [ -z "${iface}" ]; then + exit 2 + fi + if [ "${iface}" = "${req_iface}" ]; then + echo ${iface} + break + fi + bogus="${bogus} ${iface}" + done + + for iface in ${bogus}; do + ngctl shutdown ${iface}: + done +} + +# 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] | '') + ;; + *) + 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 =================================================================== 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="10.1.1.1 10.1.2.1" # Examples typically for a router. #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. +fec_interfaces="NO" # List of Fast EtherChannels (or "NO") +#fec_interfaces="fec0 fec1" +#fecconfig_fec0="fxp0 dc0" # Examples typically for two NICs +#fecconfig_fec1="em0 em1 bge0 bge1" # Examples typically for four NICs # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). Index: rc.d/netif =================================================================== RCS file: /home/ncvs/src/etc/rc.d/netif,v retrieving revision 1.21 diff -u -r1.21 netif --- rc.d/netif 30 Dec 2006 22:53:20 -0000 1.21 +++ rc.d/netif 28 Jan 2007 14:52:36 -0000 @@ -57,6 +57,9 @@ # Create cloned interfaces clone_up + # Create Fast EtherChannel interfaces + fec_up + # Create IPv6<-->IPv4 tunnels gif_up From owner-freebsd-rc@FreeBSD.ORG Sun Jan 28 15:30:23 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3978716A401 for ; Sun, 28 Jan 2007 15:30:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1B1BF13C471 for ; Sun, 28 Jan 2007 15:30:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0SFUMeQ058056 for ; Sun, 28 Jan 2007 15:30:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0SFUMvK058055; Sun, 28 Jan 2007 15:30:22 GMT (envelope-from gnats) Date: Sun, 28 Jan 2007 15:30:22 GMT Message-Id: <200701281530.l0SFUMvK058055@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Norikatsu Shigemura Cc: Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Norikatsu Shigemura List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 15:30:23 -0000 The following reply was made to PR conf/104884; it has been noted by GNATS. From: Norikatsu Shigemura To: freebsd-rc@FreeBSD.org Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf Date: Mon, 29 Jan 2007 00:04:59 +0900 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. > You can access the state of your problem report at any time > via this link: > http://www.freebsd.org/cgi/query-pr.cgi?pr=104884 > >Category: conf > >Responsible: freebsd-bugs > >Synopsis: Add support EtherChannel configuration to rc.conf > >Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 I chased HEAD. Please see following patch. Anyone, please handle this PR? And I'll make a patch for 6-stable. Index: network.subr =================================================================== 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 < /dev/null 2>&1 + + bogus="" + while true; do + iface=`ng_create_one fec dummy fec` + if [ -z "${iface}" ]; then + exit 2 + fi + if [ "${iface}" = "${req_iface}" ]; then + echo ${iface} + break + fi + bogus="${bogus} ${iface}" + done + + for iface in ${bogus}; do + ngctl shutdown ${iface}: + done +} + +# 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] | '') + ;; + *) + 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 =================================================================== 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="10.1.1.1 10.1.2.1" # Examples typically for a router. #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. +fec_interfaces="NO" # List of Fast EtherChannels (or "NO") +#fec_interfaces="fec0 fec1" +#fecconfig_fec0="fxp0 dc0" # Examples typically for two NICs +#fecconfig_fec1="em0 em1 bge0 bge1" # Examples typically for four NICs # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). Index: rc.d/netif =================================================================== RCS file: /home/ncvs/src/etc/rc.d/netif,v retrieving revision 1.21 diff -u -r1.21 netif --- rc.d/netif 30 Dec 2006 22:53:20 -0000 1.21 +++ rc.d/netif 28 Jan 2007 14:52:36 -0000 @@ -57,6 +57,9 @@ # Create cloned interfaces clone_up + # Create Fast EtherChannel interfaces + fec_up + # Create IPv6<-->IPv4 tunnels gif_up From owner-freebsd-rc@FreeBSD.ORG Sun Jan 28 20:05:09 2007 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@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-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." 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-- From owner-freebsd-rc@FreeBSD.ORG Sun Jan 28 20:10:22 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8386E16A401 for ; Sun, 28 Jan 2007 20:10:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 65B5013C441 for ; Sun, 28 Jan 2007 20:10:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0SKALp9075027 for ; Sun, 28 Jan 2007 20:10:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0SKALpX075024; Sun, 28 Jan 2007 20:10:21 GMT (envelope-from gnats) Date: Sun, 28 Jan 2007 20:10:21 GMT Message-Id: <200701282010.l0SKALpX075024@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Florent Thoumie Cc: Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Florent Thoumie List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 20:10:22 -0000 The following reply was made to PR conf/104884; it has been noted by GNATS. From: Florent Thoumie To: Norikatsu Shigemura Cc: freebsd-rc@FreeBSD.org, freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf Date: Sun, 28 Jan 2007 19:37:03 +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-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 29 11:08:45 2007 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A77116A5F9 for ; Mon, 29 Jan 2007 11:08:45 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 640C813C4A6 for ; Mon, 29 Jan 2007 11:08:45 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0TB8jZB042174 for ; Mon, 29 Jan 2007 11:08:45 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0TB8hip042170 for freebsd-rc@FreeBSD.org; Mon, 29 Jan 2007 11:08:43 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 29 Jan 2007 11:08:43 GMT Message-Id: <200701291108.l0TB8hip042170@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2007 11:08:45 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/48881 rc [PATCH] The influence of /etc/start_ifname on /etc/rc. o conf/98758 rc [patch] Templatize 'jail_fstab' in /etc/rc.d/jail o conf/98846 rc [patch] Templatize 'jail_rootdir' in /etc/rc.d/jail o bin/104623 rc "rc.d/ppp restart" stops all instances of ppp o conf/105689 rc syslogd starts too late at boot o conf/107155 rc /etc/rc.d/ppp-user does not bring up pppoe at boot o conf/107278 rc [patch] possible DoS when using the jail_interface opt o conf/107316 rc [rc.d]: [base] [rpc.lockd] nfslocking restart does not o conf/107364 rc pf fails to start on bootup after system update from F o conf/108226 rc second copy of ppp started at boot time 10 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/45226 rc Fix for rc.network, ppp-user annoyance o conf/48870 rc [PATCH] rc.network: allow to cancel interface status d o conf/55916 rc [PATCH] ppp-user options o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/73677 rc [patch] add support for powernow states to power_profi o conf/74817 rc [patch] network.subr: fixed automatic configuration of o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/78906 rc [patch] Allow mixer_enable="NO" in rc.conf o conf/79196 rc [PATCH] configurable dummynet loading from /etc/rc.co o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/85363 rc syntax error in /etc/rc.d/devfs o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o conf/88913 rc [patch] wrapper support for rc.subr o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/89870 rc [patch] feature request to make netif verbose rc.conf o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/95162 rc [patch] Missing feature in rc.subr o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/99595 rc [PATCH] /etc/rc.d/dhclient doesn't interact well with o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/102700 rc [PATCH] Add encrypted /tmp support to GELI/GBDE rc.d s o conf/102722 rc kerberos5 server startupscript should use --detach o conf/102913 rc /etc/rc.d/named killall in jailed OS o conf/103486 rc [rc.d] [patch] rc.d/jail: mount fstab after devfs o conf/103489 rc [rc.d] [patch] named_chroot_autoupdate doesn't work in o conf/103976 rc rc.d/named restart failure o conf/104408 rc command not set in rc.d/isdnd, can't stop isdnd with t o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/104884 rc [patch] Add support EtherChannel configuration to rc.c o conf/105145 rc [PATCH] add redial function to rc.d/ppp o conf/105568 rc [patch] Add more flexibility to rc.conf, to choose "_e o conf/105570 rc [patch] to allow tun(4) in rc.conf 'cloned_interfaces' o conf/106009 rc [patch] Fix pppoed startup script to process multiply o conf/106873 rc [patch] rc.d/nfslocking does not properly restart o conf/106978 rc "daily run" incorrectly assumes auth.log is rolled mor o conf/107035 rc bridge interface given in rc.conf not taking an (stati 38 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 29 16:53:19 2007 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2634016A400; Mon, 29 Jan 2007 16:53:19 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.freebsd.org (Postfix) with ESMTP id A46E413C4A6; Mon, 29 Jan 2007 16:53:18 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.8/8.13.8/NinthNine) with SMTP id l0TGrH5p042100; Tue, 30 Jan 2007 01:53:17 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Tue, 30 Jan 2007 01:53:17 +0900 From: Norikatsu Shigemura To: Florent Thoumie Message-Id: <20070130015317.6c052297.nork@FreeBSD.org> In-Reply-To: <45BCFB5F.2040509@FreeBSD.org> References: <20061029010934.5afef73e.nork@FreeBSD.org> <200610281610.k9SGAIVb051055@freefall.freebsd.org> <20070129000459.b2dba4e0.nork@FreeBSD.org> <45BCFB5F.2040509@FreeBSD.org> X-Mailer: Sylpheed 2.3.0rc (GTK+ 2.10.9; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sakura.ninth-nine.com [219.127.74.121]); Tue, 30 Jan 2007 01:53:17 +0900 (JST) Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org, freebsd-rc@FreeBSD.org, Norikatsu Shigemura Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2007 16:53:19 -0000 On Sun, 28 Jan 2007 19:37:03 +0000 Florent Thoumie wrote: > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=104884 > >>> Category: conf > >>> Responsible: freebsd-bugs > >>> Synopsis: Add support EtherChannel configuration to rc.conf > >>> Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 > > 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 Thanks for your handling. > about technical details, so I'll only focus on style. Here are my > comments on the patch: I think that the answer of all questions is 'BECAUSE netgraph's specification.'. :-) > > Index: network.subr > > =================================================================== > > 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=`expr "${line}" : '.* name="\([a-z]*[0-9]*\)" .*'` > > + if [ -n "${t}" ]; then > > + echo ${t} > > + return > > + fi > > + done > > +} I implemented ng_mkpeer and ng_create_one as generic functions. If anyone want to add other netgraph function, they can use these functions. > > +ng_fec_create() { > > + local req_iface iface bogus > > + req_iface="$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? Ah! This code's meaning was changed from original code. Yes, I think that this code should be removed. > > + ngctl shutdown ${req_iface}: > /dev/null 2>&1 > > + bogus="" > > + while true; do > > + iface=`ng_create_one fec dummy fec` > > + if [ -z "${iface}" ]; then > > + exit 2 > > + fi > > + if [ "${iface}" = "${req_iface}" ]; then > > + echo ${iface} > > + break > > + fi > > + bogus="${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 Your understanding is right:-). But we cannot control unit number in 'ngctl mkpeer', because 'Find the first free unit number for a new interface' strategy in sys/netgraph/ng_fec.c#ng_fec_get_unit. > that iface is higher than req_iface (which would loop undefinitely)? Previously, I removed req_iface by ngctl shutdown. So not reache infinity:-). > > +# 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). I obtained gif_up code. I don't know why/where are problem in it. > > --- 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="10.1.1.1 10.1.2.1" # Examples typically for a router. > > #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. > > +fec_interfaces="NO" # List of Fast EtherChannels (or "NO") > Set to '' instead of 'NO' as explained above. same as gif_interfaces, too. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 29 17:00:42 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6595616A401 for ; Mon, 29 Jan 2007 17:00:42 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 48E9D13C4A8 for ; Mon, 29 Jan 2007 17:00:42 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0TH0gna074812 for ; Mon, 29 Jan 2007 17:00:42 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0TH0gaR074811; Mon, 29 Jan 2007 17:00:42 GMT (envelope-from gnats) Date: Mon, 29 Jan 2007 17:00:42 GMT Message-Id: <200701291700.l0TH0gaR074811@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Norikatsu Shigemura Cc: Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Norikatsu Shigemura List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2007 17:00:42 -0000 The following reply was made to PR conf/104884; it has been noted by GNATS. From: Norikatsu Shigemura To: Florent Thoumie Cc: Norikatsu Shigemura , freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf Date: Tue, 30 Jan 2007 01:53:17 +0900 On Sun, 28 Jan 2007 19:37:03 +0000 Florent Thoumie wrote: > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=104884 > >>> Category: conf > >>> Responsible: freebsd-bugs > >>> Synopsis: Add support EtherChannel configuration to rc.conf > >>> Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 > > 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 Thanks for your handling. > about technical details, so I'll only focus on style. Here are my > comments on the patch: I think that the answer of all questions is 'BECAUSE netgraph's specification.'. :-) > > Index: network.subr > > =================================================================== > > 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=`expr "${line}" : '.* name="\([a-z]*[0-9]*\)" .*'` > > + if [ -n "${t}" ]; then > > + echo ${t} > > + return > > + fi > > + done > > +} I implemented ng_mkpeer and ng_create_one as generic functions. If anyone want to add other netgraph function, they can use these functions. > > +ng_fec_create() { > > + local req_iface iface bogus > > + req_iface="$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? Ah! This code's meaning was changed from original code. Yes, I think that this code should be removed. > > + ngctl shutdown ${req_iface}: > /dev/null 2>&1 > > + bogus="" > > + while true; do > > + iface=`ng_create_one fec dummy fec` > > + if [ -z "${iface}" ]; then > > + exit 2 > > + fi > > + if [ "${iface}" = "${req_iface}" ]; then > > + echo ${iface} > > + break > > + fi > > + bogus="${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 Your understanding is right:-). But we cannot control unit number in 'ngctl mkpeer', because 'Find the first free unit number for a new interface' strategy in sys/netgraph/ng_fec.c#ng_fec_get_unit. > that iface is higher than req_iface (which would loop undefinitely)? Previously, I removed req_iface by ngctl shutdown. So not reache infinity:-). > > +# 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). I obtained gif_up code. I don't know why/where are problem in it. > > --- 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="10.1.1.1 10.1.2.1" # Examples typically for a router. > > #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. > > +fec_interfaces="NO" # List of Fast EtherChannels (or "NO") > Set to '' instead of 'NO' as explained above. same as gif_interfaces, too. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 29 17:15:49 2007 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EB7916A401; Mon, 29 Jan 2007 17:15:49 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by mx1.freebsd.org (Postfix) with ESMTP id 1413813C442; Mon, 29 Jan 2007 17:15:47 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from smtp.xbsd.org (unknown [82.233.2.192]) by smtp1-g19.free.fr (Postfix) with ESMTP id E14A89B9CB; Mon, 29 Jan 2007 18:15:45 +0100 (CET) Received: from localhost (localhost.xbsd.org [127.0.0.1]) by smtp.xbsd.org (Postfix) with ESMTP id 6F31C1164F; Mon, 29 Jan 2007 18:15:45 +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 JxJwUvkZ+nqB; Mon, 29 Jan 2007 18:15:35 +0100 (CET) Received: from [193.95.134.156] (mayday.esat.net [193.95.134.156]) by smtp.xbsd.org (Postfix) with ESMTP id 5FD0811611; Mon, 29 Jan 2007 18:15:34 +0100 (CET) Message-ID: <45BE2BC7.30406@FreeBSD.org> Date: Mon, 29 Jan 2007 17:15:51 +0000 From: Florent Thoumie User-Agent: Thunderbird 1.5.0.9 (X11/20070122) MIME-Version: 1.0 To: Norikatsu Shigemura References: <200701291700.l0TH0gaR074811@freefall.freebsd.org> In-Reply-To: <200701291700.l0TH0gaR074811@freefall.freebsd.org> X-Enigmail-Version: 0.94.1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig3C1315AA345CB877ABCD4D34" Cc: freebsd-rc@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2007 17:15:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3C1315AA345CB877ABCD4D34 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Norikatsu Shigemura wrote: > The following reply was made to PR conf/104884; it has been noted by GN= ATS. >=20 > From: Norikatsu Shigemura > To: Florent Thoumie > Cc: Norikatsu Shigemura , freebsd-bugs@FreeBSD.org, > FreeBSD-gnats-submit@FreeBSD.org, freebsd-rc@FreeBSD.org > Subject: Re: conf/104884: Add support EtherChannel configuration to rc.= conf > Date: Tue, 30 Jan 2007 01:53:17 +0900 >=20 > On Sun, 28 Jan 2007 19:37:03 +0000 > Florent Thoumie wrote: > > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D104884 > > >>> Category: conf > > >>> Responsible: freebsd-bugs > > >>> Synopsis: Add support EtherChannel configuration to rc.con= f > > >>> Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 > > > 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 > =20 > Thanks for your handling. > =20 > > about technical details, so I'll only focus on style. Here are my > > comments on the patch: > =20 > I think that the answer of all questions is 'BECAUSE netgraph's > specification.'. :-) =2E.. which I don't really know, so better not take everything I write as= face value :-) > > > 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 > > > +} > =20 > I implemented ng_mkpeer and ng_create_one as generic functions. > If anyone want to add other netgraph function, they can use > these functions. I wasn't commenting this one, seemed alright to me. > > > +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 functio= n to > > other scripts? > =20 > Ah! This code's meaning was changed from original code. Yes, > I think that this code should be removed. > =20 > > > + 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 > >=20 > > 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 > =20 > Your understanding is right:-). But we cannot control unit number > in 'ngctl mkpeer', because 'Find the first free unit number for a > new interface' strategy in sys/netgraph/ng_fec.c#ng_fec_get_unit. > =20 > > that iface is higher than req_iface (which would loop undefinitely)?= > =20 > Previously, I removed req_iface by ngctl shutdown. So not reache > infinity:-). Fair enough. > > > +# fec_up ifn > > > +# Configure Fast EtherChannel for interface $ifn. Returns 0 if FE= C > > > +# 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 w= ith > > the 'for' loop. If it's an empty list, then it just won't do anythin= g. > > Default has to be '' and not 'NO' (but it seems more sensible anyway= ). > =20 > I obtained gif_up code. I don't know why/where are problem in it. No problem, just seemed bad style to me :-) --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer --------------enig3C1315AA345CB877ABCD4D34 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 iD8DBQFFvivMMxEkbVFH3PQRCny3AJ4xgCVFGTFMEKVlG9xIxSpVZHbCywCeOhSh sod+QxcYxMjAkupUSK7ph/o= =5W2+ -----END PGP SIGNATURE----- --------------enig3C1315AA345CB877ABCD4D34-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 29 17:50:27 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61B7A16A401 for ; Mon, 29 Jan 2007 17:50:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 0494113C48D for ; Mon, 29 Jan 2007 17:50:26 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0THoQoD077674 for ; Mon, 29 Jan 2007 17:50:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0THoQsf077673; Mon, 29 Jan 2007 17:50:26 GMT (envelope-from gnats) Date: Mon, 29 Jan 2007 17:50:26 GMT Message-Id: <200701291750.l0THoQsf077673@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Florent Thoumie Cc: Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Florent Thoumie List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2007 17:50:27 -0000 The following reply was made to PR conf/104884; it has been noted by GNATS. From: Florent Thoumie To: Norikatsu Shigemura Cc: freebsd-rc@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: conf/104884: Add support EtherChannel configuration to rc.conf Date: Mon, 29 Jan 2007 17:15:51 +0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3C1315AA345CB877ABCD4D34 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Norikatsu Shigemura wrote: > The following reply was made to PR conf/104884; it has been noted by GN= ATS. >=20 > From: Norikatsu Shigemura > To: Florent Thoumie > Cc: Norikatsu Shigemura , freebsd-bugs@FreeBSD.org, > FreeBSD-gnats-submit@FreeBSD.org, freebsd-rc@FreeBSD.org > Subject: Re: conf/104884: Add support EtherChannel configuration to rc.= conf > Date: Tue, 30 Jan 2007 01:53:17 +0900 >=20 > On Sun, 28 Jan 2007 19:37:03 +0000 > Florent Thoumie wrote: > > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D104884 > > >>> Category: conf > > >>> Responsible: freebsd-bugs > > >>> Synopsis: Add support EtherChannel configuration to rc.con= f > > >>> Arrival-Date: Sat Oct 28 16:10:18 GMT 2006 > > > 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 > =20 > Thanks for your handling. > =20 > > about technical details, so I'll only focus on style. Here are my > > comments on the patch: > =20 > I think that the answer of all questions is 'BECAUSE netgraph's > specification.'. :-) =2E.. which I don't really know, so better not take everything I write as= face value :-) > > > 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 > > > +} > =20 > I implemented ng_mkpeer and ng_create_one as generic functions. > If anyone want to add other netgraph function, they can use > these functions. I wasn't commenting this one, seemed alright to me. > > > +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 functio= n to > > other scripts? > =20 > Ah! This code's meaning was changed from original code. Yes, > I think that this code should be removed. > =20 > > > + 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 > >=20 > > 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 > =20 > Your understanding is right:-). But we cannot control unit number > in 'ngctl mkpeer', because 'Find the first free unit number for a > new interface' strategy in sys/netgraph/ng_fec.c#ng_fec_get_unit. > =20 > > that iface is higher than req_iface (which would loop undefinitely)?= > =20 > Previously, I removed req_iface by ngctl shutdown. So not reache > infinity:-). Fair enough. > > > +# fec_up ifn > > > +# Configure Fast EtherChannel for interface $ifn. Returns 0 if FE= C > > > +# 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 w= ith > > the 'for' loop. If it's an empty list, then it just won't do anythin= g. > > Default has to be '' and not 'NO' (but it seems more sensible anyway= ). > =20 > I obtained gif_up code. I don't know why/where are problem in it. No problem, just seemed bad style to me :-) --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer --------------enig3C1315AA345CB877ABCD4D34 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 iD8DBQFFvivMMxEkbVFH3PQRCny3AJ4xgCVFGTFMEKVlG9xIxSpVZHbCywCeOhSh sod+QxcYxMjAkupUSK7ph/o= =5W2+ -----END PGP SIGNATURE----- --------------enig3C1315AA345CB877ABCD4D34-- From owner-freebsd-rc@FreeBSD.ORG Fri Feb 2 21:50:20 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1303016A400 for ; Fri, 2 Feb 2007 21:50:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id DE17D13C428 for ; Fri, 2 Feb 2007 21:50:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l12LoJjG053386 for ; Fri, 2 Feb 2007 21:50:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l12LoJZO053382; Fri, 2 Feb 2007 21:50:19 GMT (envelope-from gnats) Date: Fri, 2 Feb 2007 21:50:19 GMT Message-Id: <200702022150.l12LoJZO053382@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Bruce M Simpson Cc: Subject: Re: conf/105570: [patch] to allow tun(4) in rc.conf 'cloned_interfaces' X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce M Simpson List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 21:50:20 -0000 The following reply was made to PR conf/105570; it has been noted by GNATS. From: Bruce M Simpson To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: conf/105570: [patch] to allow tun(4) in rc.conf 'cloned_interfaces' Date: Fri, 02 Feb 2007 21:41:46 +0000 http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/105228 eliminates the need for this hack. From owner-freebsd-rc@FreeBSD.ORG Sat Feb 3 03:05:18 2007 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78D0116A408; Sat, 3 Feb 2007 03:05:18 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2262C13C4AA; Sat, 3 Feb 2007 03:05:15 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from freefall.freebsd.org (bms@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1335Eiv073253; Sat, 3 Feb 2007 03:05:14 GMT (envelope-from bms@freefall.freebsd.org) Received: (from bms@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1335EYt073249; Sat, 3 Feb 2007 03:05:14 GMT (envelope-from bms) Date: Sat, 3 Feb 2007 03:05:14 GMT From: Bruce M Simpson Message-Id: <200702030305.l1335EYt073249@freefall.freebsd.org> To: bms@FreeBSD.org, freebsd-rc@FreeBSD.org, bms@FreeBSD.org Cc: Subject: Re: conf/105570: [patch] to allow tun(4) in rc.conf 'cloned_interfaces' X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Feb 2007 03:05:18 -0000 Synopsis: [patch] to allow tun(4) in rc.conf 'cloned_interfaces' Responsible-Changed-From-To: freebsd-rc->bms Responsible-Changed-By: bms Responsible-Changed-When: Sat Feb 3 03:05:04 UTC 2007 Responsible-Changed-Why: I'm looking at this http://www.freebsd.org/cgi/query-pr.cgi?pr=105570