summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2013-02-17Suppress some pointless debugging message:Kenneth R Westerback
1) If the pipe to the priv process is closed while waiting for something to happen in the non-priv dispatch() loop, assume the priv process issued an error message and exit without additional verbiage. 2) Ditto if the pipe to the priv process is closed when the flush of IMSG_CLEANUP is attempted. 3) No need to report when SIOCDIFADDR fails because the address is already gone. Start to ensure the priv process always issues a useful message before exiting by noting when it restarts due to the LLADDR having changed. Prodded by deraadt@ to clean this up.
2013-02-17Kill a magic number. 0 -> RTP_NONE for priority in constructing routingKenneth R Westerback
messages. Prodded by otto@. RTP_NONE's home pointed out by jsg@.
2013-02-17dhclient-script did 'route -q $rdomain add $new_ip_address 127.0.0.1'.Kenneth R Westerback
i.e. did not complain (-q) if 127/8 was unreachabel from $rdomain. So don't pollute the log with new warnings about being unable to create the route. Just complain if a truly unexpected error occurs. Noted by Andreas Bartelt.
2013-02-17Put the processes in the routing domain of the interface. TweakKenneth R Westerback
error message to show problematic table id and use clearer verbiage suggested by sthen@. Should fix (another!) problem reported by Andreas Bartelt, who noted that lease renewals did not work in a non-default routing domain. ok sthen@
2013-02-16Remove accidentally committed debug statement ("Got RTM_IFINFO").Kenneth R Westerback
2013-02-15Take more care to use the correct xid, rather than packet garbage.Kenneth R Westerback
ok beck@
2013-02-15Make code a tad less obscure by using sizeof() actual variable beingKenneth R Westerback
zeroed, rather than some other variable that may be the same type.
2013-02-15Even if no one uses it, record the seconds since we started in theKenneth R Westerback
correct field.
2013-02-15Unbreak DISCOVER by initializing xid from correct field.Kenneth R Westerback
2013-02-15Don't leak routing socket fd if getting the default route fails.Kenneth R Westerback
e.g. with ESRCH. Ask for default route in correct routing domain. While here, tweak variable names to be consistant with other functions using a routing socket. Likely the cause of the periodic failures reported by Andreas Bartelt via bugs@.
2013-02-14When an interface generates an RTM_IFINFO message, it may be as theKenneth R Westerback
result of its LLADDR changing! Check said address and if it differs from what we think it is, simulate a SIGHUP to restart, getting the new address and a new lease for it. Spotted by, fix tested by, and ok beck@
2013-02-14Don't rely on the packet buffer (client->packet) being preserved betweenKenneth R Westerback
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@
2013-02-13Restore previous behaviour of not cleaning up in response to SIGTERM.Kenneth R Westerback
SIGTERM is used to make processes go away during system shutdown and NFS filesystems may be still be in use when it is received. So removing routes to the NFS servers is a bad thing. Problem discovered and fix tested by landry@.
2013-02-11Xr scan_ffs 8; requested by Scott McEachernJason McIntyre
2013-02-11Ignore sysctl failure for CPU_LIDSUSPEND when errno is EOPNOTSUPP.Todd C. Miller
Just because CPU_LIDSUSPEND is defined in cpu.h does mean it is actually supported by the hardware. OK halex@
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-09Ignore sysctl failure for CPU_LIDSUSPEND when errno is EOPNOTSUPP.Todd C. Miller
Just because CPU_LIDSUSPEND is defined in cpu.h does mean it is actually supported by the hardware. OK miod@ kettenis@
2013-02-09get the format of the various options in this file right and, alongJason McIntyre
the way, cut back on some of the crazy macros that were mostly around to appease groff; whilst there, fix the warnings reported by Jan Stary back in january; lots of help and ok krw
2013-02-06add pppx(4) interfaces to the "pppx" interface group, as done for variousStuart Henderson
other interface types. suggested/tested Mattieu Baptiste, ok dlg@ yasuoka@ giovanni@, ifconfig(8) reminder jmc@
2013-02-03Remove unused (a.k.a. always passed NULL) parameter 'data' fromKenneth R Westerback
decode_udp_ip_header() and the useless check of it. Part of original diff from pelikan about udp length errors.
2013-02-03Use RTM_GET rather than the sysctl/scan all routes dance to obtainKenneth R Westerback
the current default route. Much less work for the routing system. Suggested by claudio@. ok beck@
2013-02-02Expunge unused variables and pointless construction of same inKenneth R Westerback
bind_lease().
2013-02-02Fix resolv.conf magic. Add identifying comment to generated resolv.confKenneth R Westerback
so it is easy to see which interface generated it.
2013-02-02Dereference correct pointer. Fix crash when checking whether resolv.confKenneth R Westerback
should be written. Bad cut 'n paste.
2013-02-01do not leak dn if there is no resolv.conf contents; found by llvmFlorian Obser
ok krw@
2013-02-01always initialize cur_time; found by llvmFlorian Obser
ok krw@
2013-02-01do not leak lease in error path; found by llvmFlorian Obser
ok krw@
2013-02-01Increment size of buffer to accomodate terminating NUL *after* usingKenneth R Westerback
same variable to determine if cumulative lengths of strings to be put in buffer are > 0. Otherwise we always think here is something to put in buffer. Reported by florian@ and his friend llvm.
2013-02-01Handle a non-existant resolv.conf.tail without issuing an errorKenneth R Westerback
message. Handle an empty resolv.conf.tail without exiting. Don't leak an fd if fstat() on resolv.conf.tail fails. Make fstat() failure on successfully opened resolv.conf.tail a fatal error. From Tim van der Molen. Thanks!
2013-02-01Write out resolv.conf only if the default route is under the controlKenneth R Westerback
of the process binding the lease. Re-check the default route whenever a routing message arrives that might mean the default route has changed, and write out resolv.conf if appropriate. Reduces the chances that the name servers in resolv.conf are unreachable. Problem most eloquently explained, and solution suggested by beck@.
2013-01-27Refactor code a bit. Calculate resolv.conf contents once when binding aKenneth R Westerback
lease and reuse as required whenever resolv.conf is written. Use write_file() rather than a custom message/functions to write out resolv.conf.
2013-01-26Oops. Restore "no domain-name, no domain-name-seervers means don'tKenneth R Westerback
touch resolv.conf" behaviour.
2013-01-26Read /etc/resolv.conf.tail once on startup and save contents forKenneth R Westerback
application during subsequent resolv.conf building.
2013-01-26Whitespace tweaks.Kenneth R Westerback
2013-01-22Whitespace nit. Better error messages.Kenneth R Westerback
2013-01-19be more explicit about default file locations; ok krwJason McIntyre
2013-01-18tweak -L; ok krwJason McIntyre
2013-01-18-L before -l;Jason McIntyre
2013-01-18Change a bunch of error()'s to warning()'s in the dispatch loop.Kenneth R Westerback
Set 'quit' to exit the loop in those situations, allowing more cleanup() attempts in those error situations.
2013-01-18Add command line option '-L' that specifies an optional file into whichKenneth R Westerback
the most recent offer and effective leases will be written. Intended to allow access to dhcp option information that was formerly passed to dhclient-script.
2013-01-17Try harder to clear out default routes on the interface beingKenneth R Westerback
configured. Only exempt default routes labelled as being the property of another dhclient.
2013-01-17remove a uesless Pp;Jason McIntyre
2013-01-16Unrevert last reversion. otto@ pointed out that it wasn't asprintf()Kenneth R Westerback
causing a problem, it was accessing uninitialized pointers.
2013-01-16Revert last. asprintf() breaks something.Kenneth R Westerback
2013-01-16Use the magic of asprintf() to produce more informative errorKenneth R Westerback
and log messages.
2013-01-16Don't tell the priviledged process to discard active_addr if there isKenneth R Westerback
a pending address addition. Should fix "routehandler: interface address added" messages and premature exiting of dhclient seen by henniing@ amoung others.
2013-01-16for consistency with prio etc, the queue assignment really belongsHenning Brauer
into the set block. so make pfctl accept, print and the manpage document . match set queue foo instead of . match queue foo but keep accepting the old way without the explicit set. ok bob, man jmc
2013-01-15Add IMSG_WRITE_FILE and associated bits to allow the unprivilegedKenneth R Westerback
process to ask that a file be written by the privileged process. Not yet used.
2013-01-14First convert packet to lease, which validates option data andKenneth R Westerback
discards bad options. THEN check to see if any required options are missing and reject both OFFER and ACK packets that lack required options. Since it is the latter's lease we actual bind. Move required option check into packet_to_lease() instead of duplicating it.
2013-01-13More informative error message.Kenneth R Westerback