From owner-freebsd-bugs Wed Nov 10 2:40: 8 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 98F1C1525B for ; Wed, 10 Nov 1999 02:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA30810; Wed, 10 Nov 1999 02:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from ns.skylink.it (ns.skylink.it [194.177.113.1]) by hub.freebsd.org (Postfix) with ESMTP id ADAF814EFC for ; Wed, 10 Nov 1999 02:39:48 -0800 (PST) (envelope-from hibma@skylink.it) Received: from heidi.plazza.it (va-165.skylink.it [194.185.55.165]) by ns.skylink.it (8.9.1/8.8.8) with ESMTP id LAA03413 for ; Wed, 10 Nov 1999 11:40:40 +0100 Received: (from n_hibma@localhost) by heidi.plazza.it (8.9.3/8.8.5) id RAA02566; Tue, 9 Nov 1999 17:14:34 GMT Message-Id: <199911091714.RAA02566@heidi.plazza.it> Date: Tue, 9 Nov 1999 17:14:34 GMT From: hibma@skylink.it Reply-To: hibma@skylink.it To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: conf/14810: [PATCH] initialising multiple interfaces through DHCP does not work Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 14810 >Category: conf >Synopsis: [PATCH] initialising multiple interfaces through DHCP does not work >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 10 02:40:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Nick Hibma >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: FreeBSD hare 4.0-CURRENT FreeBSD 4.0-CURRENT #7: Tue Nov 9 17:58:56 CET 1999 toor@henny:/usr/src/sys/compile/HARE i386 >Description: In my configuration I have two ethernet interfaces that I would like to configure through DHCP. In rc.conf: ifconfig_ed1="DHCP" ifconfig_wb0="DHCP" This does not work for the second interface as dhclient bails out on the fact that port 68 is already taken (by dhclient started for the first interface). >How-To-Repeat: Add a second (bogus possibly) network interface to your rc.conf >Fix: Instead of starting a dhclient for each interface, start on for all of them at the same time. --- /etc/rc.network.orig Tue Nov 9 17:01:34 1999 +++ /etc/rc.network Tue Nov 9 18:04:12 1999 @@ -77,11 +77,11 @@ ;; esac + dhcp_interfaces="" for ifn in ${network_interfaces}; do - showstat=false if [ -r /etc/start_if.${ifn} ]; then . /etc/start_if.${ifn} - showstat=true + eval showstat_$ifn=1 fi # Do the primary ifconfig if specified @@ -92,15 +92,22 @@ '') ;; [Dd][Hh][Cc][Pp]) - ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn} - showstat=true + # DHCP inits are done all in one go below + dhcp_interfaces="$dhcp_interfaces $ifn" + eval showstat_$ifn=1 ;; *) ifconfig ${ifn} ${ifconfig_args} - showstat=true + eval showstat_$ifn=1 ;; esac + done + + if [ ! -z "${dhcp_interfaces}" ]; then + ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces} + fi + for ifn in ${network_interfaces}; do # Check to see if aliases need to be added # alias=0 @@ -108,7 +115,7 @@ eval ifconfig_args=\$ifconfig_${ifn}_alias${alias} if [ -n "${ifconfig_args}" ]; then ifconfig ${ifn} ${ifconfig_args} alias - showstat=true + eval showstat_$ifn=1 alias=`expr ${alias} + 1` else break; @@ -120,14 +127,15 @@ eval ifconfig_args=\$ifconfig_${ifn}_ipx if [ -n "${ifconfig_args}" ]; then ifconfig ${ifn} ${ifconfig_args} - showstat=true + eval showstat_$ifn=1 fi + done - case ${showstat} in - true) + for ifn in ${network_interfaces}; do + eval showstat=\$showstat_${ifn} + if [ ! -z ${showstat} ]; then ifconfig ${ifn} - ;; - esac + fi done # Warm up user ppp if required, must happen before natd. And the uuencoded version (to maintain overlong lines): begin 644 rc.network.diff M+2TM("]E=&,OVYE='=OVEF;GT@73L@=&AE;@H@"0D)+B`O971C+W-T87)T7VEF+B1[ M:69N?0HM"0D)VEF;GT*+0D)"7-H;W=S=&%T/71R M=64**PD)"2,@1$A#4"!I;FETV1H8W!?:6YT97)F86-EV1H M8W!?9FQA9W-]("1[9&AC<%]I;G1EVEF;GU?86QI87,D>V%L:6%S?0H@"0D):68@6R`M;B`B M)'MI9F-O;F9I9U]AVEF8V]N9FEG7V%R9W-](&%L:6%S"BT)"0D)`H@"0EI9B!;("UN("(D>VEF8V]N9FEG7V%R9W-](B!=.R!T:&5N M"B`)"0EI9F-O;F9I9R`D>VEF;GT@)'MI9F-O;F9I9U]AW-H;W=S=&%T?2!I;@HM"0ETB`D>W-H;W=S=&%T M?2!=.R!T:&5N"B`)"0EI9F-O;F9I9R`D>VEF;GT*+0D)"3L["BT)"65S86,* M*PD)9FD*(`ED;VYE"B`*(`DC(%=ARelease-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message