summaryrefslogtreecommitdiff
path: root/sbin/dhclient
AgeCommit message (Collapse)Author
2018-02-08Don't update first_sending in state_selecting() and thusKenneth R Westerback
fix the accounting for the interval since we started the process of getting a lease. Fixes the 'no lease ... got lease' messaging at a minimum.
2018-02-07Keep track of the last proposal used to configure the interface andKenneth R Westerback
compare that to the offered proposal to determine if there are any changes to configure. Simpler, and fixes issue where using a recorded lease meant the interface was continually being configured with the same information.
2018-02-06Abstract "no link ..." and "no lease ..." message generationKenneth R Westerback
into a function tick_msg(). Now both work the same way, dot dot dotting as time passes until they 'sleep'. Tested by tb@ as part of a larger diff.
2018-02-06Nuke unused state S_REBINDING. We just use the timeKenneth R Westerback
to decide between unicast and broadcast for REQUEST.
2018-02-06When binding a lease from the dhclient.leasees.<if> file andKenneth R Westerback
the renewal time is in the past wait retry_interval before trying to renew the lease.
2018-02-06Fix fprintf() to include "\n" where needed. Prefix "no lease"Kenneth R Westerback
messages with interface name. Spotted by & ok tb@
2018-02-06Flip -q (be quiet) into -v (be noisy), making terseness the defaultKenneth R Westerback
behaviour. Always go daemon after link_timeout seconds and complete lease negotiations in the background if necessary. No hanging around in the foreground for the full 64 seconds waiting for a server to appear. Log a more relevant message when a default route can't be obtained via RTM_GET. i.e. "no default route" rather than "No such process". -q -> -v ok mpi@
2018-02-05Ensure that the "bound to ..." message appears in the log unlessKenneth R Westerback
dhclient was started with '-d'. Move the "yielding responsibility" message to log_debug(). Stop logging duplicate "bound to ..." messages now that one is guaranteed to be present when the address is first bound. Thins out logs. Especially if you run with '-q'.
2018-02-05Always run through state_preboot() when starting up or theKenneth R Westerback
link status changes. Simplifies some logic.
2018-02-05Nuke unused parameter to go_daemon().Kenneth R Westerback
2018-01-30Expand "bound to ..." message to include the source of the lease,Kenneth R Westerback
either the server IP/MAC or the name of the leases file. Prompted by phessler@ and landry@ feedback to another diff. ok phessler@
2018-01-29Repair botched retry loop when generating RTM_PROPOSALKenneth R Westerback
messages at startup. Reproducible situation found on vnet(4) and fix tested by jca@.
2018-01-29Missed a couple of log_info()'s in previous commit. Use #ifdef DEBUGKenneth R Westerback
instead of #if DEBUG.
2018-01-29Use log_init(), log_setverbose() and log_debug() moreKenneth R Westerback
appropriately. Fixes '-q' logging oddities. Prompted by phessler@ plea for '-v'-like behaviour rather than putting everything under DPRINTF()'s.
2018-01-28Refactor and simplify the logic to select and invoke theKenneth R Westerback
appropriate function to process a packet.
2018-01-28A few fatal() -> fatalx() where errno is notKenneth R Westerback
relevant.
2018-01-25Add DPRINTF() and use it to replace log_debug() statements insideKenneth R Westerback
#ifdef DEBUG/#endif blocks. Suggestions on correct idiom (C99 vs gcc) from millert@ ok tom@
2018-01-24Don't display the seconds until renewal. i.e. "em0: bound to 1.2.3.4Kenneth R Westerback
-- renewal in 300000 seconds" becomes simply "em0: bound to 1.2.3.4" While here avoid setting timeouts before the current time. ok florian@
2018-01-05Complete and fix grammar in comments and bring grammar terms,Kenneth R Westerback
function names and function code into sync.
2018-01-04Compact some whitespace, unsplit now shorter lines.Kenneth R Westerback
2018-01-04Comments and grammar use '_decl' so use _decl instead of _declarationKenneth R Westerback
in the names of the respective parsing functions.
2018-01-04parse_lease_time() is an unnecessary abstraction. Just useKenneth R Westerback
parse_number('L') since it is parsing unsigned 32bit integers.
2018-01-04We only parse decimal numbers, so parse_decimal() -> parse_number() toKenneth R Westerback
match grammar comments and improve euphony.
2018-01-02More grammar comments improvements.Kenneth R Westerback
2018-01-01Tweak syntax comments into consistency and completeness.Kenneth R Westerback
2017-12-20Always 'send' host-name, rather than relying on dhclient.conf to askKenneth R Westerback
for it. Removes the need to install a dhclient.conf for a default configuration. Install script simplification to follow. General enthusiasm. ok millert@ benno@ tom@ ian@
2017-12-18Stop inserting and paying attention to 'interface <if>;'Kenneth R Westerback
inside 'lease {}' declarations. We don't keep leases from multiple interfaces in dhclient.leases.<if> files. One less thing to parse and keep in memory. More rope for those wanting to do unspeakable things with their lease files.
2017-12-17Further simplifY lease parsing. Fold add_lease() into read_lease_db(),Kenneth R Westerback
and move all lease parsing into parse_lease().
2017-12-16With leases no longer in dhclient.conf, rename a bunch ofKenneth R Westerback
functions and fields to more obvious names reflecting this separation.
2017-12-13Fix whitespace botch that snuck in.Kenneth R Westerback
2017-12-13Simplifiy parser by not worrying about nesting 'interface <if> {}'Kenneth R Westerback
statements. They are silly but harmless and work fine.
2017-12-09Add ACTION_IGNORE and nuke ignored_options, ignored_option_count fieldsKenneth R Westerback
in struct client_config.
2017-12-08When accepting a BOOTP lease, do not leak offered values of leaseKenneth R Westerback
time, renewal time, rebinding time. Use the ACTION_DEFAULT mechanism to set the default expiry time for any lease so gauche as to not provide one. Use the DHCP default lease times for BOOTP leases instead of, bizarrely, shorter times.
2017-12-07adjust the "timeout" text, now that leases are no longerJason McIntyre
specified in dhclient.conf; ok krw
2017-12-07Set ifi->offer to NULL after free'ing it.Kenneth R Westerback
2017-12-07Nuke support for defining last-gasp leases in dhclient.conf.Kenneth R Westerback
2017-12-06Disentangle dhclient.conf static lease handling from dynamicKenneth R Westerback
lease handling. Simplifies code and makes it easier to consider excising this 'feature'.
2017-12-05When removing duplicate dynamic leases from the cache, compare theKenneth R Westerback
SSID against ifi->ssid, not the SSID of the new lease. They should be the same, but this makes the intent clearer and removes an assumption about the contents of ifi->active.
2017-12-04change "if (lp &&" to "if lp != NULL &&".Theo Buehler
pointed out by krw
2017-12-04Avoid a NULL-deref in get_recorded_lease() leading to a segfault seenTheo Buehler
by aja and others. ok krw
2017-12-03Move timer fields 'expiry" and "rebind" out of struct client_leaseKenneth R Westerback
and into struct interface_info. Nuke set_lease_times().
2017-12-03Abandon nagging about "_" violating RFC 952. This removes the needKenneth R Westerback
for a custom res_hnok(), so just use the libc version of res_hnok(). Requested by deraadt@
2017-11-27Simplify lease_as_string() logic to use a single time_t variableKenneth R Westerback
and lease_[expiry|rebind|renewal]() functions.
2017-11-27Fix pasto so lease_rebind() returns rebind value and notKenneth R Westerback
renewal value.
2017-11-26Move rebind time calculation to a function lease_rebind(), just likeKenneth R Westerback
lease_expiry() and lease_renewal(). Simplifies logic and upcoming changes.
2017-11-24Remove 'renewal' field from struct client_lease. Add lease_renewal() toKenneth R Westerback
calculate the value when required for a particular lease.
2017-11-23Fix use of lease_expiry() in set_lease_times(). lease_expiry() returnsKenneth R Westerback
wall clock time, not length of lease time.
2017-11-20Wnen purging dhclient.leases and when looking for unexpired offers toKenneth R Westerback
use, always recalculate offer expiry time based on the information in the original offer.
2017-11-18Generate correct time comments (renewal/rebind/expiry) inKenneth R Westerback
dhclient.leases and the 'offered' lease generated by -L. i.e. the times contained in the actual offer, and not the 'effective' times that reflect changes imposed by dhclient.conf or -i.
2017-11-14Treat invalid server name as empty instead of declining the lease offeredMartin Pieuchot
by such misconfigured DHCP servers. Original diff from and ok krw@, ok sthen@