summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2012-12-01Make privileged process daemonize too. Using same function as theKenneth R Westerback
non-privileged process, go_daemon(). As pointed out by kettenis@, otherwise it is still attached to a controlling terminal and subject to the dangers thereof. Prep for having the privileged process pay attention to signals.
2012-12-01A couple of whitespace nits.Kenneth R Westerback
2012-11-30get rid of unneeded \n here. err(3) family already does it for us.Gleydson Soares
OK mikeb@ camield@ reyk@ sobrado@ henning@ krw@
2012-11-29use Nm instead of Xr to self;Jason McIntyre
2012-11-29Prevent VPN traffic leakages in dual-stack hosts/networks.Reyk Floeter
See http://tools.ietf.org/html/draft-gont-opsec-vpn-leakages. We forcibly block IPv6 traffic by loading a "flow esp out from ::/0 to ::/0 type deny" unless the protocol is used in any of the flows. Note that this will block any IPv6 traffic, superseding routes and pf, on the host by default when iked is running with IPv4 flows only. This auto-blocking feature can be disabled by specifying the "-6" command line flag to iked. Thanks to Fernando Gont. ok mikeb@
2012-11-29Nobody looks at the result of fork_privchld(), so make it returnKenneth R Westerback
void and not int/pid_t.
2012-11-29Nuke unused 'extern' declaration.Kenneth R Westerback
2012-11-27Clean up parsing of option lists. Part 7 (and final).Kenneth R Westerback
Allow 'request ;', 'require ;' and 'ignore ;' as requests to create empty lists of options. Thus enabling the removal of built-in lists or the removal of global lists inside an 'interface' declaration.
2012-11-27Clean up parsing of option lists. Part 6.Kenneth R Westerback
Treat 'ignore' option lists the same as 'request' and 'require' option lists. i.e. keep a list of the options rather than using an ACTION flag. So overriding a previous ignore list will not leave breadcrumbs and incorrect ACTIONs lying around. The list will be applied when the new lease is created, and will override any ACTION specified for the option. Mention in dhclient.conf(5) that each request/require/ignore statement will override any previous one.
2012-11-27Clean up parsing of option lists. Part 5.Kenneth R Westerback
Don't toss away an existing request/require list unless the new list is successfully parsed.
2012-11-25Clean up parsing of option lists. Part 3.Kenneth R Westerback
Storing an option in a list more than once is silly, wastes space and is possibly confusing to sensitive dhcp servers. Make it a syntax error to attempt to store an option in a list more than once.
2012-11-25Clean up parsing of option lists. Part 2.Kenneth R Westerback
DHO_PAD ("pad") and DHO_END ("option-end") are not really options and it makes no sense to require, request, or ignore them. And probably would confuse some sensitive dhcp servers.
2012-11-25Clean up parsing of option lists. Part 1.Kenneth R Westerback
1) Add config->required_options_count so that syntactically incorrect request statement in dhclient.conf is completely ignored. 2) Pass size of buffer being filled instead of assuming 256. 3) Always zero (a.k.a. DHO_PAD) the passed in buffer. 4) Check for out of bounds index before using it, not after. Add TOK_IGNORE to syntax in comment. No intentional functional change other than catching bad request statements.
2012-11-24Don't segfault if no subnet-mask is provided, or is marked 'ignore'Kenneth R Westerback
in dhclient.conf. Always zero out stack masks rather than using stack garbage when no subnet-mask is provided.
2012-11-23Mention hardmtu in the list relating to hwfeatures, suggested by jmc@Stuart Henderson
2012-11-23Display hardmtu value when "ifconfig hwfeatures" is used.Stuart Henderson
Looks fine reyk@ ok mikeb@
2012-11-23Missed file from last commit.Kenneth R Westerback
2012-11-23Use the libutil imsg framework rather than a hand-rolled localKenneth R Westerback
version. This is the last hand-rolled imsg implementation I could spot. Doesn't seem to break sparc64. Suggested by chris@, tweaks from brad@ and reyk@. ok reyk@
2012-11-17'deeleting' -> 'deleting' in comment.Kenneth R Westerback
2012-11-16Call discover_interface() before forking, so both processes will knowKenneth R Westerback
the interface index, hardware address, etc. as well as the interface name.
2012-11-16Add missing 'break;' so that IFT_ETHER, etc. routes are deleted asKenneth R Westerback
intended.
2012-11-16promote some debug messages to warnings; ok reykMike Belopuhov
2012-11-15Shuffle #include's to use the majority idiom everywhere - i.e. useKenneth R Westerback
dhcpd.h to pull in most sys/net/netinet/etc. .h file. Eliminate superfluous #include's.
2012-11-15If '-d' is specified to keep dhclient from daemonizing, don'tKenneth R Westerback
redirect privileged child's STDIN/OUT/ERROR to /dev/null. This was already avoided for the unprivileged process. Makes printf/note debugging easier.
2012-11-14Oops. Commit the one that actually compiles.Kenneth R Westerback
2012-11-14When copying option.data, use option.len to specify the amount ofKenneth R Westerback
data to copy, rather than a static value that *may* be incorrect. e.g. when option.data is NULL. Allows 'ignore subnet-mask;' to work. Prompted by a different but similar problem found by jmc@.
2012-11-14Remove useless _new_ and _old_ from various function names to makeKenneth R Westerback
them shorter and eliminate implications about what the function does. No functional change.
2012-11-11Fix dhclient.conf 'default' directive which was also broken in codeKenneth R Westerback
refactoring. i.e. use specified value if server has provided no data.
2012-11-11supersede/append/prepend actions should work even if the dhcp serverKenneth R Westerback
doesn't send any data for the affected option. This was broken when the supersede/append/prepend/ignore logic was refactored. Reported by and fix tested by johnw via misc@
2012-11-09Remove now unused files.Kenneth R Westerback
2012-11-08Remove confusing extra address abstraction 'struct iaddr'. Just useKenneth R Westerback
'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@.
2012-11-08Remove lie about dhclient configuring all interfaces. MentionKenneth R Westerback
'egress' as a special interface name.
2012-11-08Close routing socket fd leak when deleting old address.Kenneth R Westerback
Spotted by zinke@.
2012-11-07Nuke unused struct and function declarations.Kenneth R Westerback
2012-11-07Always memcpy() into/out of option data rather than hoping the char *Kenneth R Westerback
will be always be aligned. Don't pass around pointers into option data - use variable that has the memcpy()'d data.
2012-11-07Use memset() consistently rather than tossing in a few bzero()'s.Kenneth R Westerback
2012-11-07Use memcpy() consistently rather than tossing in a few bcopy()'s.Kenneth R Westerback
2012-11-07Kill some annoying extra spaces. No code change.Kenneth R Westerback
2012-11-06Ensure that if_exists() always closes its socket before returning.Lawrence Teo
Also fix a bug where the return value of if_exists() was not checked correctly if the interface disappears while pflogd is running. ok beck henning
2012-11-06Kill two unused functions, subnet_number() and broadcast_addr().Kenneth R Westerback
2012-11-05Some systems give ENETUNREACH when trying to add the 'standard'Kenneth R Westerback
host route, a.k.a. 'route add w.x.y.z 127.0.0.1'. Since dhclient-script ignored the failure, ignore it here too until it can be explained or we stop creating these routes.
2012-11-04Properly clear the UP flag while forcing the interface down/upStefan Sperling
rather than setting all flags to zero. ok krw deraadt
2012-11-04Use consistant initialization idiom to reduce confusion.Kenneth R Westerback
2012-11-04No need to pass interface name around when flushing routes.Kenneth R Westerback
2012-11-04No need to pass interface name around when creating routes.Kenneth R Westerback
2012-11-03Various fixes/tweaks for resolv.conf handling:Kenneth R Westerback
1) Don't leak a file descriptor if there are no contents for resolv.conf. 2) Allow for only resolv.conf.tail to go into resolv.conf. 3) Don't need to pass around interface name when creating resolv.conf. 4) Don't leave 0 length resolv.conf lying around if there are no contents.
2012-11-03While this identical idiom caused problems when building an ifaliasreqKenneth R Westerback
to *add* an address, here (building an ifaliasreq to delete an address) it worked fine. But change it to the bcopy() dance that works in the adding case just to be consistant until a sparc64/gcc guru is cornered in a bar with a full keg of guiness.
2012-11-02Avoid some misaligned access on sparc64 (at least) by bcopy()'ingKenneth R Westerback
in_addr_t values into s_addr's rather than assigning them. Possibly not the ideal solution, but at least dhclient will work again on sparc64.
2012-11-02Don't add a 'nameserver' line to resolv.conf if the nameserver inKenneth R Westerback
question is the empty string. Spotted by Joerg Zinke.
2012-11-02Watch the non-privileged end of the pipe to the privileged childKenneth R Westerback
process. So when the child dies, the parent exits immediately.