summaryrefslogtreecommitdiff
path: root/sbin/dhclient
AgeCommit message (Collapse)Author
2013-11-16Fix msgbuf_write() usage.Kenneth R Westerback
2013-11-12add a variety of missing prototypesTheo de Raadt
2013-11-11Shuffle function prototypes and extern declarations around toKenneth R Westerback
put local functions prototypes and variables in their .c files, and cross-file functions into .h files. Prompted by deraadt@.
2013-11-11Nuke 'cur_time' variable used only to assign time(NULL) to a field.Kenneth R Westerback
2013-11-11Argh. Set 'to' address to INADDR_BROADCAST, not 'from' address,Kenneth R Westerback
when trying to send broadcast request to server.
2013-11-11RFC 2131 and friends state that when renewing a lease the clientKenneth R Westerback
will begin by using unicast communications with the server, and fall back to using broadcast packets if unicast fails. We were not failing back, but instead doggedly sticking with unicast attempts until the lease expired. Instead, try unicast requests for the reboot timeout interval and then switch to using broadcast requests. Problem reported by Marc Peters and Dennis den Brok via misc@. ok dlg@ millert@
2013-10-22Save 'next-server' (a.k.a. siaddr) info in leases file. Saving theKenneth R Westerback
file name without the server address seems silly. Tested & ok uwe@
2013-09-09Calculate the lease time fields (expiry, renew, rebind) afterKenneth R Westerback
applying the option directives (ignore, default, supersede) from dhclient.conf. This allows the options dhcp-lease-time, dhcp-rebinding-time, and dhcp-renewal-time to be controlled via dhclient.conf. Also set BOOTP lease times by faking up these options rather than crudely jamming in fixed times, allowing them to become configurable via dhclient.conf. Imperviousness of the time options pointed out by todd@.
2013-08-22this full stop has lost its way...Jason McIntyre
2013-08-17Do not create a route to the bound address via 127.0.0.1. Our stackKenneth R Westerback
should be able to correctly short-circuit packet routing to local addresses without this. Requested by many over the years, most recently chrisz@. Get it in early to see if anything does break. ok claudio@ henning@
2013-08-14Only skip address deleting/adding and route deleting/adding onFlorian Obser
identical lease when we are in state S_RENEWING. Otherwise we can end up without an IP address on the interface because dhclient thinks it's still there and doesn't add it. Found the hard way during suspend/resume. OK krw@
2013-07-16Add missing .Mt macros for AUTHORS email addresses.Ingo Schwarze
From Jan Stary <hans at stare dot cz>. ok jmc@
2013-07-15If a DHCPREQUEST returns a lease identical to the one currently bound toKenneth R Westerback
the interface, skip the address deleting/adding and route deleting/adding and simply update the timestamps. Suggested by sthen@. Tweaks from millert@. ok sthen@ millert@
2013-07-14merge the relevant bits of dhcp(8) into dhclient(8) and dhcpd(8),Jason McIntyre
removing traces of dhcp(8)... i'm about to remove that file, since it's essentially useless. holding off for a little, in case my commit is greeted with howls. help/ok krw
2013-07-11update (or add) STANDARDS;Jason McIntyre
help/ok krw
2013-07-11Put more debug verbiage under DEBUG. Add a few more debug messages.Kenneth R Westerback
Make packet discarding decisions before parsing the packet's possible options. No intended functional change.
2013-07-07Remove erroneous warnings -- we do not reject offers just because theKenneth R Westerback
option buffer(s) end badly.
2013-07-06Tone down verbosity by putting the "Unexpected <blah>" messages underKenneth R Westerback
#ifdef DEBUG. They were mostly for, well, debugging.
2013-07-06Fix a lie in one comment and zap a pointless sentence in another.Kenneth R Westerback
2013-07-06Zap leading whitespace.Kenneth R Westerback
2013-07-05Zap trailing whitespace.Kenneth R Westerback
2013-06-18Don't use inet_ntoa() twice in one parameter list. You'll just printKenneth R Westerback
one of the strings twice. Spotted by mpi@, who also tweaked the diff by pointing out INET_ADDRSTRLEN. Should fix mysterious messages like "1.2.3.4, not 1.2.3.4, deleted from ...".
2013-06-18Split RTM_NEWADDR and RTM_DELADDR handling into separate casesKenneth R Westerback
rather than 1 case with a check to see which messages it was. More code duplication, easier to read. No functional change.
2013-06-17Check calloc() return value. Plug leak of resulting memory.Kenneth R Westerback
Latter from dhill.
2013-06-09Make route adding interface more flexible by passing flags to beKenneth R Westerback
used rather than deducing them. Use priv_add_route() to add the 127.0.0.1 address when adding an address.
2013-06-09Fix/clarify some comments. do memset()'s only when variable is goingKenneth R Westerback
to be used.
2013-06-09Re-apply static route and classless static route support -- this timeKenneth R Westerback
passing the correct destination for the default route, '0.0.0.0', rather than the new lease address. Populating egress group works this time. Problem found the hard way by Chris Smith.
2013-06-09Re-apply route adding code refactoring -- it wasn't the problem thatKenneth R Westerback
broke populating the egress group.
2013-06-09Add back backslash fixes caught in rollback.Kenneth R Westerback
2013-06-09Backout static/classless route handling and default route refactoringKenneth R Westerback
since the former relies on the latter and the latter breaks 'egress' group populating.
2013-06-04Add support for static routes option (33) and classless staticKenneth R Westerback
routes option (121). ok sthen@
2013-06-04Fix "\" escape handling in read_string().Kenneth R Westerback
Problem noted, fix tested and ok sthen@.
2013-06-01Refactor the default route adding code to use a general route addingKenneth R Westerback
function that will be reused for future work. ok claudio@
2013-05-10Fix subnet check. Check our rdomain against the rdomains of the otherKenneth R Westerback
interfaces and not against our own. Problem noted, fix tested and ok mikeb@
2013-05-05Add a flag to struct client_state (IS_RESPONSIBLE) to record whenKenneth R Westerback
the first expected RTM_NEWADDR arrives, which signals that a lease has been bound to the interface. Ignore RTM_NEWADDR and RTM_DELADDR messages until the flag has been set. Makes it more likely that the last dhclient started will be the last dhclient standing. Fixes the problem reported by David Higgs, where restarting an install in a vm consistantly caused the new dhclient to be the one that dies.
2013-05-02Bunch of comment/whitespace cleanup. Eliminate some misleading orKenneth R Westerback
pointless ones, make multiline comments readable, nuke '...' in favour of '.', etc.
2013-05-02Enough of the hand-rolling of queues. Turn client->leases andKenneth R Westerback
client->offered_leases into TAILQs.
2013-04-27Use same parse_date() and date writing logic as in dhcpd. i.e.Kenneth R Westerback
strptime() rather than handrolling parsing. Change date format in leases to same as dhcpd, fixing 'u' vs 'w' error made in initial strftime() introduction.
2013-04-25big int_t/time_t fixes; ok deraadt@ krw@Otto Moerbeek
2013-04-24Follow ISC and freebsd by increasing ip_ttl on packets from 16 toKenneth R Westerback
128, so people living many hops from their dhcp server can still get leases. Pointed out by deraadt@
2013-04-05send_packet() and writev() return ssize_t, not int. Use correctKenneth R Westerback
type to store the returned value. From dhill.
2013-04-05Nuke parameter to do_packet() not used since 2006. From dhill.Kenneth R Westerback
2013-04-02Don't assume sizeof(time_t)==4Philip Guenther
ok krw@
2013-03-30Since deleting all the addresses on an interface removes all theKenneth R Westerback
relevant entries from the arp cache, don't bother asking for/processing arp entries in the route dumps. Thus allowing use of NET_RT_FLAGS with RTF_GATEWAY and AF_INET, to ask for only the routes dhclient wants to expunge rather than all routes in existance. Greatly shrinks and simplifies the code. No intentional functional change. Tested by sthen@.
2013-03-24Simplify logic when processing route dump by using a helper functionKenneth R Westerback
delete_route(). No functional change.
2013-03-22Ignore client-identifier option in leases from a server. They're not supposedKenneth R Westerback
to be there! Instead, always record the client-identifier used to obtain the lease. Ignore recorded leases that have a different client-identifier than the one currently in force. If a client-identifier is not specified in the dhclient.conf file, construct one from the network type and MAC, like most other clients out there do these days. Thus, if one plugs in a different USB network adapter, renewing the previous lease (which upsets servers due to the MAC being different) is skipped and DISCOVER is attempted at once. Issue noted and fix tested by tedu@.
2013-03-21Free lease with free_client_lease() rather than free().Kenneth R Westerback
2013-03-21create realloc() loops around sysctl for array-based mibs, in programsTheo de Raadt
which want a "full" dump ok dlg
2013-03-13Make sure dhclient doesn't delete IPv6 routes.Paul de Weerd
OK krw@
2013-03-11When binding a lease, check for and clear out any 'zombie' routesKenneth R Westerback
left behind by dead dhclients. i.e. dhclients that no longer respond to 'kill(pid, 0)'. As a result, no need to handle the 127.0.0.1 route separately when deleting an interface. Appears to fix in passing a problem with routes vs link addresses that sthen@ was seeing. ok sthen@