summaryrefslogtreecommitdiff
path: root/sbin/dhclient/clparse.c
AgeCommit message (Collapse)Author
2016-09-01Cut back the default values for the various timeout/interval values. We noKenneth R Westerback
longer live in a 10Mb/sec shared media world with 1Mhz Vaxen DHCP servers. ok benno@ otto@ phessler@
2016-09-01Informative comments describing the various timing fields (initial_interval,Kenneth R Westerback
reboot_timeout, etc.) when setting them to their defaults.
2016-08-31Remove the 'client' global and make it per-ifp.Martin Pieuchot
ok krw@
2016-08-23Make the 'ifi' global local to dhclient.c and pass it as an argument toMartin Pieuchot
functions needing it. This is the first step to support multiple interfaces in one dhclient(8) instance. ok krw@
2016-08-16Track SSID in leases file and only consider leases from the current SSID whenKenneth R Westerback
starting up dhclient on wifi interfaces. In theory will preserve leases from other SSID's and speed up obtaining a lease by not wasting time attempting to re-acquire a lease from a different SSID. Experimental feature from n2k16 needing some real world testing before g2k16.
2016-07-31Ask for DHO_BOOTFILE_NAME and DHO_TFTP_SERVER by default. May proveKenneth R Westerback
useful to autoinstall in the future and in the meantime can provide information on what the dhcp server has done with the desired server name and file name info. Original diff from Patrik Lundin via tech@
2016-06-03The networks I use are sufficiently fast that a 10 second "reboot" timeoutTed Unangst
is not necessary, and in fact quite annoying when I swtich networks and want to get back to the init state quickly. Default instead to 1 second. The very few users who encounter problems may edit dhclient.conf. ok benno krw does not object
2016-02-06Eliminate #include inside *.h files and include only needed headers inKenneth R Westerback
each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
2015-10-26Give dhclient(8) the ability to use option 119, a.k.a. "DomainKenneth R Westerback
Search" if supplied by the server. Requested by a few. Original diff from Ray Lai via tech@. Tested & ok claudio@
2015-05-18Tweak parsing so that hostnames starting with 0-9 are accepted.Kenneth R Westerback
Reported long ago by matthieu@. Also Jacob Berkman via the lists. Tests and suggestions from Jacob and Matthieu.
2015-02-01free(NULL) works, so stop checking for non-zero length allocationKenneth R Westerback
or non-NULLness before calling free(). This batch from Benjamin Baier.
2014-11-03Don't leak static leases when the 'lease {}' parsing fails or one staticKenneth R Westerback
lease supersedes an earlier one.
2014-11-02Pesky whitespace and spurious parenthesis.Kenneth R Westerback
2014-10-27Zap extraneous whitespace and a stuttered extra 'break;'.Kenneth R Westerback
2014-05-12Since all static leases are in one file, /etc/dhclient.conf, there is noKenneth R Westerback
'wrong interface' specification. So display that error message only for non-static leases. i.e. when reading /var/db/dhclient.leases.<if>.
2014-05-11Rework/restore recorded lease handling. Actually use 'lease'Kenneth R Westerback
statements in dhclient.conf. Recorded and static leases should now be bound to interfaces when appropriate. .... Ken
2014-05-05Zap trailing whitespace. Started by pointed comments from andre@.Kenneth R Westerback
2014-05-05A couple of malloc()+memset(0) -> calloc.Kenneth R Westerback
2014-01-25Correct parsing of dhclient.conf statements 'fixed-address' andKenneth R Westerback
'next-server'. Modify new lease being cloned with their values rather than overwriting original lease being cloned.
2014-01-21Allow dhclient.conf to specify 'fixed-address', 'next-server',Kenneth R Westerback
'filename' and 'server-name'. dhclient.conf can now override anything in an offer or saved lease when creating the effective lease.
2014-01-21Add parsing for options 121 (classless-static-routes) and 249Kenneth R Westerback
(classless-ms-static-routes). dhcpd can now specify and serve these options and dhclient can recognize and use supersede, etc. statements on them. Based on a diff from Stefan Rinke. Thanks!
2014-01-20Don't silently skip the next statement when encountering anKenneth R Westerback
invalid IP in a reject statement.
2014-01-20Cast pointer to (u_int8_t *) when assigning it to a u_int8_t *Kenneth R Westerback
variable.
2014-01-19We don't have any (and I can't find elsewhere) signed 16 bit orKenneth R Westerback
signed 8 bit dhcp option types. So nuke getShort() and all 's' and 'b' format support. While here use '%u'/'%lu' and not '%d'/'%ld' to snprintf() unsigned values.
2014-01-19Redo the parsing of numbers to improve the error messages andKenneth R Westerback
make the code more readable. And prepare for some new things that will need to be parsed. ok dlg@
2014-01-19Rename parse_hardware_param() to parse_ethernet() to reflect whatKenneth R Westerback
it actually does.
2014-01-18Remove superfluous assignment to local variable 'val' just beforeKenneth R Westerback
exiting.
2014-01-18Make parse_warn() messages consistantly use 'expecting' ratherKenneth R Westerback
than occasionally 'expected'. End all with a '.'.
2014-01-18Never silently consume the following statement when unexpectedlyKenneth R Westerback
encountering a ';'. I.e. when checking the token type, 'skip_to_semi()' after 'parse_warn()' only when the parsed token wasn't a ';'.
2014-01-17Make parse_X return -1 when it encounters a parsing error. EnablesKenneth R Westerback
recognition of zero length value vs parsing error. This lets us avoid the erroneous consumption of the semicolon ending the 'X' value, and the resulting accidental consumption of the following line in the file being parsed.
2014-01-13peek_token() a bit more to replace a bunch of manual checks withKenneth R Westerback
the perfectly adequate parse_semi(). And some blocks didn't even need to peek.
2014-01-13Don't eat another token looking for a ';' after skip_to_semi() hasKenneth R Westerback
been invoked. Fixes silent loss of the statement following a broken or inapplicable 'interface' declaration in a lease, or an unrecognized lease attribute.
2014-01-13No need to 'clear the peek buffer' when closing a file. The nextKenneth R Westerback
file opener will call new_parse() to initialize that amoung other things. Nuke extraneous blank line in passing.
2014-01-12Since the return value of read_client_conf() is not checked, don'tKenneth R Westerback
bother returning one.
2014-01-10skip_to_semi() is gilding the lily when the next statement breaks outKenneth R Westerback
of the loop and closes the file being parsed. And the previous statement warns the user the leases file being parsed has been determined to be corrupt. Eliminate further gilding in the form of an 'else' after the same 'if' clause includes the 'break'.
2014-01-10KNF (UNF?). Split annoying long line.Kenneth R Westerback
2013-12-30Replace yet another hand-rolled list with a TAILQ. reject_list thisKenneth R Westerback
time.
2013-12-28Remove unused variable 'token'. Spotted by deraadt@Kenneth R Westerback
2013-12-22Don't look for two semi-colons when encountering an unrecognizedKenneth R Westerback
statement in dhclient.conf.
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-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-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-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-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-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-02-09As tedu@ pointed out a while ago, it makes little sense to discardKenneth R Westerback
an option list if it contains duplicate option names. Just ignore the duplicates.
2013-02-01do not leak lease in error path; found by llvmFlorian Obser
ok krw@