Age | Commit message (Collapse) | Author |
|
halex@ and krw@ pointed out that a NULL check before free can go, too.
ok deraadt@, halex@, krw@
|
|
DHO_CLASSLESS_MS_STATIC_ROUTES. Remove 'C' (CIDR) pretty printing
outside of those special cases. Add a bunch of paranoia to protect
against confused/malicious dhcp servers.
Since 'C' is a variable size element it can't be handled by the
existing code, which is designed for fixed size elements.
Issue found by Someya Yuuichi, reported by yasuoka@ who also provided
the first diff.
ok yasuoka@
|
|
|
|
(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!
|
|
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.
|
|
time.
|
|
time.
|
|
pretty printing, when 'X' is not used in the next switch statement.
Just keep 'X'. Makes the code a touch less mysterious.
|
|
valued options and previously snprintf()'d filename and servername
lease attributes.
Should fix "string constant too long" errors when reading back a
lease with filename or servername attributes with escaped characters.
Reported by Rivo Nurges.
|
|
to the leases file. No code existed to correctly read back the
strings so written.
Redo both sides and use vis()/strnunvis() instead of handrolling
more parsing. As a side-effect allow embedded NUL characters rather
than skipping them.
|
|
exclusively and thus simplify error checking/overflow detection.
Bail out when unknown format character found. Don't ignore last
character if it's unprintable. Print embedded NULs rather than
ignoring them.
|
|
|
|
print buffer. Use consistant idiom to increment pointer to data
being consumed, instead of hiding some increments.
|
|
replace the 'struct hardware' abstraction layer and use 'struct
ether_addr' where hardware addresses are of interest.
ok matthew@, confirmed by reyk@ not to impact DHCP-over-IPSec support.
|
|
Make packet discarding decisions before parsing the packet's possible
options. No intended functional change.
|
|
option buffer(s) end badly.
|
|
|
|
pointless ones, make multiline comments readable, nuke '...' in
favour of '.', etc.
|
|
|
|
attempts to send DISCOVER or REQUEST packets. Some DHCP servers might
NAK the DISCOVER, or other nefarious packets arrive, between attempts
and overwrite the packet being sent. Create and use another buffer
for packets being sent.
Problem encountered by fgsch@, who noticed that once the DISCOVER was
NAK'ed our dhclient sent a bunch of NAK's back to the server. Like it
thought they were DISCOVER messages.
ok beck@
|
|
causing a problem, it was accessing uninitialized pointers.
|
|
|
|
and log messages.
|
|
|
|
the option fails validation tests. Make pretty_print_option() bail
on all bad format strings, and on all incorrect option data lengths.
Check pretty_print_option() return value rather than repeating
validation with check_option(). Do res_hnok() check on host name,
domain name, and nis domain while creating lease from packet info.
As a result, nuke ipv4addrs() and check_option().
Ignore options that do not validate rather than summarily rejecting
offered lease. Treat all options whose names start with "option-"
as unknown rather than relying on a big switch on DHO_ names.
Started when reading dhclient(8) -u verbiage.
|
|
dhcpd.h to pull in most sys/net/netinet/etc. .h file. Eliminate
superfluous #include's.
|
|
'in_addr'. Remove many double conversions and other perversions.
piaddr() replaced with inet_ntoa(). dhclient is extremely unlikely
to support anything but ipv4/dhcp without a complete rewrite.
Joint work with chris@.
Positive feedback from deraadt@ zinke@ phessler@.
|
|
|
|
rather than list of option declarations. e.g. 'ignore routers;'
instead of 'ignore routers 1.2.3.4;' The value in the declaration
was being ignored anyway.
While there clean up the related code a bit.
|
|
length field for the option is present before using it. Reject lease
if no length field is present.
|
|
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.
|
|
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)
|
|
hints for the proper fix, and OK claudio@
(this was lost in my tree for far too long)
|
|
Log the packets before checking the client state. Makes it easy to
find MACs for 'surprise' DHCP servers.
Positive comments from mbalmer@, jasper@.
|
|
ok millert
|
|
ok henning otto theo
|
|
|
|
moving the minimal code into do_packet(). Eliminate repeated code for
checking the client hardware address and the reject list by putting
those checks into do_packet as well.
No functional change, just much easier to read.
ok stevesk@
|
|
parameters just those things actually needed and using existing
structs and information. No functional change.
ok stevesk@
|
|
message type option of 0 as a BOOTP offer. Don't process any option
buffer after one is found to be corrupt. Don't process overflow
buffers in a BOOTP packet. At least try to accept DHCP offers even if
a bad options buffer is encountered.
Brings code more into line with current ISC dhclient.
ok stevesk@
|
|
an option buffer. No longer accept the 6th such packet. From ISC.
ok ckuethe@ stevesk@
|
|
incoming packet. But since we bzero() the packet buffer before
copying the incoming data into it, and the options are at the end, and
we use a fixed sized buffer, and 0's are ignored as pad options, and
proper option lists end with 0xff, it's simplier to always try to scan
the whole buffer.
Problem found by, and patch tested by kettenis@.
|
|
dhcp_packet and it is contained in the global *client. So don't pass
around pointers to a struct that contains a pointer to the dhcp_packet
instance. Just use the global client->packet. Eliminate unused struct
packet members and parameter lists accordingly.
No functional change.
Suggestions by stevesk@. ok stevesk@
|
|
single, global, instance of 'struct interface_info' (ifi) rather than
passing around pointers to it.
"I agree" henning@
Testing moritz@ stevesk@, ok stevesk@
|
|
|
|
not accidentally inserting two NULL characters after each option in
the DHCPREQUEST packet.
Thanks to Christian Jones for the problem report and tcpdump's, and to
Emmett Pate for finding a problematic Linksys model still in my local
stores.
ok deraadt@
|
|
|
|
let a trailing nul byte force hex printing)
FreeBSD PR 83468 by Sean Winn <sean@gothic.net.au>, via jmc@
|
|
|
|
always sent. Fold store_options into cons_options. Eliminate priority
list of options.
ok deraadt@
|