From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 16:07:59 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE8CF16A400; Mon, 2 Jul 2007 16:07:59 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (grnl-static-02-0046.dsl.iowatelecom.net [69.66.56.110]) by mx1.freebsd.org (Postfix) with ESMTP id 61ECE13C45B; Mon, 2 Jul 2007 16:07:59 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.8/8.13.8) with ESMTP id l62Fmjft001960; Mon, 2 Jul 2007 10:48:45 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.8/8.13.8/Submit) id l62FmjoM001959; Mon, 2 Jul 2007 10:48:45 -0500 (CDT) (envelope-from brooks) Date: Mon, 2 Jul 2007 10:48:45 -0500 From: Brooks Davis To: Andrew Thompson Message-ID: <20070702154845.GA1693@lor.one-eyed-alien.net> References: <20070701041055.GA82649@heff.fud.org.nz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <20070701041055.GA82649@heff.fud.org.nz> User-Agent: Mutt/1.5.15 (2007-04-06) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 02 Jul 2007 10:48:45 -0500 (CDT) Cc: brooks@freebsd.org, FreeBSD Current Subject: Re: dhclient-script will reload a module X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2007 16:07:59 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2007 at 04:10:55PM +1200, Andrew Thompson wrote: > Hi, >=20 > Recently ifconfig was given the -n flag to suppress module loading so the > userland teardown scripts did not cause a module to load again. This is > still happening when dhcp is used as dhclient calls ifconfig internally. > The following patch addresses that, any objections? Looks fine to me (I think -n should be the default). -- Brooks >=20 > Andrew >=20 >=20 > Index: dhclient-script > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/sbin/dhclient/dhclient-script,v > retrieving revision 1.16 > diff -u -p -r1.16 dhclient-script > --- dhclient-script 13 Apr 2007 15:07:10 -0000 1.16 > +++ dhclient-script 1 Jul 2007 04:06:02 -0000 > @@ -22,6 +22,7 @@ > ARP=3D/usr/sbin/arp > AWK=3D/usr/bin/awk > HOSTNAME=3D/bin/hostname > +IFCONFIG=3D'/sbin/ifconfig -n' > NETSTAT=3D/usr/bin/netstat > =20 > LOCALHOST=3D127.0.0.1 > @@ -55,11 +56,11 @@ arp_flush() { > } > =20 > delete_old_address() { > - eval "ifconfig $interface inet -alias $old_ip_address $medium" > + eval "$IFCONFIG $interface inet -alias $old_ip_address $medium" > } > =20 > add_new_address() { > - eval "ifconfig $interface \ > + eval "$IFCONFIG $interface \ > inet $new_ip_address \ > netmask $new_subnet_mask \ > broadcast $new_broadcast_address \ > @@ -73,14 +74,14 @@ add_new_address() { > =20 > delete_old_alias() { > if [ -n "$alias_ip_address" ]; then > - ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1 > + $IFCONFIG $interface inet -alias $alias_ip_address > /dev/null 2>&1 > #route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1 > fi > } > =20 > add_new_alias() { > if [ -n "$alias_ip_address" ]; then > - ifconfig $interface inet alias $alias_ip_address netmask \ > + $IFCONFIG $interface inet alias $alias_ip_address netmask \ > $alias_subnet_mask > #route add $alias_ip_address $LOCALHOST > fi > @@ -276,14 +277,14 @@ fi > =20 > case $reason in > MEDIUM) > - eval "ifconfig $interface $medium" > - eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1 > + eval "$IFCONFIG $interface $medium" > + eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1 > sleep 1 > ;; > =20 > PREINIT) > delete_old_alias > - ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.= 255 up > + $IFCONFIG $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255= =2E255 up > ;; > =20 > ARPCHECK|ARPSEND) > @@ -346,7 +347,7 @@ TIMEOUT) > fi > fi > fi > - eval "ifconfig $interface inet -alias $new_ip_address $medium" > + eval "$IFCONFIG $interface inet -alias $new_ip_address $medium" > delete_old_routes > exit_with_hooks 1 > ;; > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >=20 --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGiR5dXY6L6fI4GtQRAnzCAKDOfOqXiEPqjnW54nGvsnDw0GUdZACfe/ZD Gsfxof3s7xv5rSn50Ikq/7k= =SPlr -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--