From owner-freebsd-current Mon Aug 12 1:40:30 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E257337B400 for ; Mon, 12 Aug 2002 01:40:23 -0700 (PDT) Received: from vbook.express.ru (asplinux.ru [195.133.213.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 126E543E4A for ; Mon, 12 Aug 2002 01:40:23 -0700 (PDT) (envelope-from vova@express.ru) Received: from vova by vbook.express.ru with local (Exim 3.36 #1) id 17eAkP-0000Hq-00 for current@freebsd.org; Mon, 12 Aug 2002 12:40:21 +0400 Subject: rcNG and dhcp From: "Vladimir B. " Grebenschikov To: "current@freebsd.org" Content-Type: multipart/mixed; boundary="=-WfoFwyEqReuP8oy9WkFg" X-Mailer: Ximian Evolution 1.0.7 Date: 12 Aug 2002 12:40:20 +0400 Message-Id: <1029141620.800.14.camel@vbook.express.ru> Mime-Version: 1.0 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-WfoFwyEqReuP8oy9WkFg Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi There is patch to teach rcNG do not try dhcp on not-connected ethernet. simply put ifconfig_fxp0="dhcp-if-carrier" into rc.conf It will be interested to somebody Theoretically there are another solution for problem - add new key to dhclient - check interface media before broadcasting. -- Vladimir B. Grebenschikov vova@sw.ru, SWsoft, Inc. --=-WfoFwyEqReuP8oy9WkFg Content-Disposition: attachment; filename=rcNg-network1.if-media.patch Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=rcNg-network1.if-media.patch; charset=KOI8-R --- /usr/local/src/etc/rc.d/network1 Mon Jul 29 15:09:46 2002 +++ /etc/rc.d/network1 Mon Aug 12 11:43:03 2002 @@ -157,6 +157,17 @@ case ${ifconfig_args} in '') ;; + [Dd][Hh][Cc][Pp]-[Ii][Ff]-[Cc][Aa][Rr][Rr][Ii][Ee][Rr]) + # Load interface .ko if need + ifconfig $ifn > /dev/null 2>&1 + sleep 3=20 + # Check media option of interface + media=3D`ifconfig $ifn | awk '($1 =3D=3D "media:") { ok=3D1; print $4; = } END { if (ok !=3D 1) { print "(none)"; } }' 2> /dev/null` + if [ "$media" !=3D "(none)" ]; then + dhcp_interfaces=3D"$dhcp_interfaces $ifn" + eval showstat_$ifn=3D1 + fi + ;; [Dd][Hh][Cc][Pp]) # DHCP inits are done all in one go below dhcp_interfaces=3D"$dhcp_interfaces $ifn" --=-WfoFwyEqReuP8oy9WkFg-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message