From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 28 15:29:54 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 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-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 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