Date: Tue, 5 Aug 2003 00:02:47 +0200 (CEST) From: Martin Blapp <mb@imp.ch> To: Larry Rosenman <ler@lerctr.org> Cc: current@freebsd.org Subject: Re: dhclient/dhclient.conf change in -CURRENT? Message-ID: <20030804235635.D31668@cvs.imp.ch> In-Reply-To: <46160000.1060021293@lerlaptop-red.iadfw.net> References: <20030804163850.B31668@cvs.imp.ch> <4000000.1060009773@lerlaptop-red.iadfw.net> <20030804174343.C31668@cvs.imp.ch> <50200000.1060012588@lerlaptop-red.iadfw.net> <80120000.1060015295@lerlaptop-red.iadfw.net> <38060000.1060020889@lerlaptop-red.iadfw.net> <46160000.1060021293@lerlaptop-red.iadfw.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Larry, This patch should fix the issues. It is not perfect, because polling here is a bit complicated. Maybe it does the right thing, but I think dhclient should at least check if one of the conditions is suddenly right (we are associated, or we really have link). So this needs definitly some work, but it should fix your case. I'll fix the remaining issues tomorrow. Martin --- src/contrib/isc-dhcp/includes/dhcpd.h.orig Mon Aug 4 23:57:06 2003 +++ src/contrib/isc-dhcp/includes/dhcpd.h Mon Aug 4 23:57:37 2003 @@ -782,6 +782,7 @@ char name [IFNAMSIZ]; /* Its name... */ int linkstatus; /* Link status */ int ieee802; /* True if media is ieee802 */ + int mediaflag; /* True if dhclient.conf has media settings */ int index; /* Its index. */ int rfdesc; /* Its read file descriptor. */ int wfdesc; /* Its write file descriptor, if --- src/contrib/isc-dhcp/client/dhclient.c.orig Mon Jul 28 15:25:04 2003 +++ src/contrib/isc-dhcp/client/dhclient.c Mon Aug 4 23:56:04 2003 @@ -413,6 +413,11 @@ INTERFACE_REQUESTED)) continue; set_ieee802(ip); + if (ip -> client -> config -> media != NULL) + ip->mediaflag = 1; + else + ip->mediaflag = 0; + script_init (ip -> client, "PREINIT", (struct string_list *)0); if (ip -> client -> alias) @@ -1385,9 +1390,6 @@ int interval; int increase = 1; - if (interface_active(client -> interface) == 0) - return; - /* Figure out how long it's been since we started transmitting. */ interval = cur_time - client -> first_sending; @@ -1427,6 +1429,9 @@ } } + if (interface_active(client -> interface) == 0) + return; + /* If we're supposed to increase the interval, do so. If it's currently zero (i.e., we haven't sent any packets yet), set it to one; otherwise, add to it a random number between @@ -3222,6 +3227,13 @@ return (1); } } + + /* + * If dhclient.conf contains media settings, we cannot + * abort if the interface is not set to active mode. + */ + if (ip->mediaflag) + return (1); return (0); #else /* ifdef __FreeBSD__ */ Martin Blapp, <mb@imp.ch> <mbr@FreeBSD.org> ------------------------------------------------------------------ ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH Phone: +41 61 826 93 00 Fax: +41 61 826 93 01 PGP: <finger -l mbr@freebsd.org> PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E ------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030804235635.D31668>