summaryrefslogtreecommitdiff
path: root/sbin/dhclient
AgeCommit message (Collapse)Author
2012-10-11Remove the new (as of r1.56) line of code which updates ifi->linkstat inStuart Henderson
the dispatch loop again; in the case where two RTM_IFINFO link changes occur immediately after each other (as in the case with trunk and probably vlan) dhclient missed the state change of the second interface. ok krw@, who points out that dhcp packets received between the two RTM_IFINFO messages would be lost, however the window is small (<0.4ms on my laptop) and this is better than not noticing the link change.
2012-10-10Revert r1.155. Routing breaks if dhclient-script flushes theKenneth R Westerback
interface's routes when the interface is down. Prevents floods of RTM_MISS messages on 'ifconfig down'. And might fix the vpn related failures pirofti@ is seeing.
2012-09-22last stage of rfc changes, using consistent Rs/Re blocks, and moving theJason McIntyre
references into a STANDARDS section;
2012-09-18Once resolv.conf.saved has been copied back as resolv.conf, delete it soKenneth R Westerback
it isn't copied again the next time a dhclient goes away. Do the resolv.conf.saved restore for v6 as well since v6 goes through the trouble to create resolv.conf.saved. ok beck@
2012-09-18Don't accept leases that offer a subnet that is already configuredKenneth R Westerback
on an interface. Crude hammer that may be refined as needed. Feedback from tedu@, beck@, sthen@ claudio@
2012-09-17When a link is lost, call dhclient-script with reason "FAIL". ThisKenneth R Westerback
does the resolv.conf dance and removes 'dead' routes, rather than leaving these droppings behind. When dhclient is exiting after calling dhclient-script with "FAIL", give the script a couple of seconds to finish. Also pass the lease parameters (old_*) to dhclient-script so routes can be cleaned up in this path too. ok beck@
2012-09-17De-obfuscate and update reality correspondance of some comments.Kenneth R Westerback
2012-09-01Oops. Missed a reinitialize_interface() declaration.Kenneth R Westerback
2012-09-01Nuke a static global I can't get my head around - interfaces_invalidated.Kenneth R Westerback
Since reinitialize_interface() was simply setting interfaces_invalidated to 0, nuke it too! Always update ifi->linkstat in dispatch() loop.
2012-08-31Nuke a bunch of annoying "/* Send a packet. */" comments aboveKenneth R Westerback
invocations to send_packet(), and similiar combinations.
2012-08-29no point having two copies of this file - this copy never gotJason McIntyre
installed anyway; ok krw henning
2012-08-26Junk global cur_time, and use time(NULL) or local variables whereKenneth R Westerback
time is checked multiple times. Add a set_timeout_interval() function to allow setting a timeout based on an interval from current time. Fixes issues with initial startup where the global cur_time was always old and caused initial DHCPDISCOVER or DHCPREQUEST packets to be sent multiple times. And probably other timeout related oddities. Tested by naddy@
2012-08-22add ignore keyword to conf file, allowing one to ignore unwanted infoTed Unangst
from the server without necessarily speciyfing a supersede value
2012-08-21Don't abandon time_t precision for intervals. Use (long long) and %lld whenKenneth R Westerback
printing, rather than (int) and %d. Follows idiom used for 64-bit size_t and off_t. Suggested by deraadt@
2012-08-18Don't store a time_t into an int. Make the variable time_t.Kenneth R Westerback
Part of larger time_t rectification diff from guenther@.
2012-08-18Don't try to printf() a time_t value with %d. Cast to (int) justKenneth R Westerback
in case time_t ever changes size. Values in these cases are intervals, i.e. (time_t - time_t) so int/%d will be fine. Part of larger time_t rectification diff from guenther@.
2012-08-18Remove unused field 'next' from struct timeout. There's only oneKenneth R Westerback
timeout now, not a list.
2012-08-18Update global cur_time after exiting poll() and before calling theKenneth R Westerback
state engine for packet processing. Time may have passed! Use cur_time in routing message processing. Makes sense to todd@
2012-07-26Make interface_status() assume that a link is up when IFM_AVALIDKenneth R Westerback
is not set. This is what the late interface_link_status() did. Allows drivers who cannot tell what the link state is to get dhcp leases. Prodding by henning@. ok deraadt@ miod@
2012-07-09Terminate with extreme prejudice the multiple timeout queuingKenneth R Westerback
mechanism that was a holdover from when dhclient handled multiple interfaces at once. There is only one timeout possible at a time. Also move calculation of current time to just before check to see if the timeout has expired. ok beck@ guenther@
2012-06-26Add some more paranoia and make code clearer. Check that the requiredKenneth R Westerback
length field for the option is present before using it. Reject lease if no length field is present.
2012-06-26RFC 2132 says "Options containing NVT ASCII data SHOULD NOT includeKenneth R Westerback
a trailing NULL; however, the receiver of such options MUST be prepared to delete trailing nulls if they exist." So delete (all) trailing NUL's when parsing NVT ASCII options. Should fix odd results when 'append'ing info to such options via dhclient.conf. FreeBSD commit to fix 'append' logic in a different way pointed out by brad.
2012-06-24Nuke interface_link_status() (check media status only) and useKenneth R Westerback
interface_status() (check IFF_UP|IFF_RUNNING and media status). The interface is forced up when dhclient starts so the flags should be correct. Thanks to guenther@ for pointing out the original raison d'etre of the difference between the two.
2012-06-22Two 'ioctl() < 0' -> 'ioctl() == -1'. guenther@ says they're odd.Kenneth R Westerback
2012-06-22Set state to S_REBOOTING when calling state_reboot() and set stateKenneth R Westerback
inside state_reboot() to S_INIT when calling state_init(). Rather than the other way around. Makes for more consistant idiom and might reduce state confusion.
2012-06-20Cancel all timeouts in state_reboot(), since we can get there from any stateMark Kettenis
if a link state change happens. Fixes a problem where we'd continue to send (corrupted) discover packets after binding. ok krw@
2012-01-15Make dhclient use the correct rdomain for all requests for leases, notPeter Hessler
just the first one. from Joel Knight OK krw@
2011-12-10Try harder to re-initialize parsing state so nothing accidentallyKenneth R Westerback
carries over when a new file (i.e. leases after config) is parsed. May help with mysterious "Corrupt lease file" messages.
2011-12-10Tweak parsing. No need to declare, assign and then ignore the tokenKenneth R Westerback
value when only the token id is required.
2011-12-10Tweak leases file handling.Kenneth R Westerback
1) Write out new leases file every time a lease is obtained. i.e. don't append 20 leases before cleaning it up. 2) Write new leases file after calling dhclient-script to implement new info. Gets interface configured first, and makes it more likely the leases file reflects most current configuration.
2011-05-11Make dhclient more friendly to sequential option processing byKenneth R Westerback
always starting DHCP packet options with DHO_DHCP_MESSAGE_TYPE. Now DHCP-specific options always come after the option identifying the packet as DHCP rather than BOOTP. Makes at least Nortel NetIP DHCP server happier. Clean up some code and parameter passing. Closes PR#6543, as confirmed by original submitter and patch tester Len Zaifman. Thanks! ok matthew@ (who hates the ISC-like code)
2011-04-17by default we ignore unknown dhcp server options, so don't botherPeter Hessler
warning unless we ask dhclient to reject leases with unknown options OK krw@ (this was lost in my tree for even longer)
2011-04-17fix a possible division by zero if a server sends us a broken optionPeter Hessler
hints for the proper fix, and OK claudio@ (this was lost in my tree for far too long)
2011-04-09We are incorrectly processing option 33 (static route), treatingKenneth R Westerback
is as a host route rather than a classful network route. Too much trouble to fix such an obsolete feature, so ignore option 33 info.
2011-04-04route(8) has a -q option. No need for all this >/dev/null 2>&1Kenneth R Westerback
stuff.
2011-04-04Align man page with current reality.Kenneth R Westerback
2011-04-04Stray '$medium' missed in last commit.Kenneth R Westerback
2011-04-04Dump some useless calls to dhclient-script. i.e. MEDIUM, PREINIT,Kenneth R Westerback
ARPSEND, ARPCHECK. Drop support for 'media', 'medium' and 'alias' specifications in dhclient.conf. Old leases still parse but these options now have no effect. Be more polite and decline all offers we don't accept. Fix a IMSG length check. Many expressions of support at various bars. ok henning@ deraadt@ beck@
2011-03-27Fix interval handling. Start at initial_interval instead ofKenneth R Westerback
exponentially backed off initial_interval. Don't hallucinate that we can send ARP packets without waiting. Don't claim to be waiting for ARP packets when not doing so. Correctly detect expiry of selecting period. Speeds up negotiations. Tested on various dhcp servers by Martin Pelika, ian@, and David Coppa. And works at Starbucks and a mall for me.
2011-03-27new sentence, new line;Jason McIntyre
2011-03-26Correct described default for initial-interval. It is three, notKenneth R Westerback
ten, seconds. Use words not numerals consistently when naming various timing values. Tweak one clumsy sentence.
2011-03-02no need for a separate NOTES section; ok henningJason McIntyre
2010-10-23make sure an interface is registered before we start using itPeter Hessler
found by clang OK claudio@, krw@
2010-10-15Add and ignore DHCP option 66/0x42 TFTP server name.Jonathan Gray
ok krw@ phessler@
2010-10-08use the right capitalization in the Nd strings.Igor Sobrado
ok jmc@
2010-09-24Make it possible to use "dhclient egress" to refetch a lease withoutClaudio Jeker
rememberingwhich interface dhclient was actually active on. Requested by deraadt, OK deraadt@, krw@
2010-07-03Fix the naming of interfaces and variables for rdomains and rtablesPhilip Guenthe
and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
2010-07-02garbage collect an unused function; ok claudioTheo de Raadt
2010-06-26malloc/strlcpy -> strdup. Apparently I forgot to commit this one withKenneth R Westerback
the similar changes to dhcpd.
2010-06-26Whitespace.Kenneth R Westerback