Commit Graph

301 Commits

Author SHA1 Message Date
Roy Marples
decc33d0b2 Allow testing of INFORM and REQUEST messages. 2009-07-11 18:54:43 +00:00
Roy Marples
321898d721 Don't print (null) when there is no NAK message. 2009-07-11 15:14:31 +00:00
Roy Marples
735e9a2062 Ensure that DBDIR and RUNDIR exist if defined as /var/db/dhcpcd and/or /var/run/dhcpcd. 2009-07-08 19:22:31 +00:00
Roy Marples
9578248878 Change get_option_addr to accept struct in_addr * instead of uint32_t *
to fix an alignment issue on SGI MIPS.
2009-07-08 17:01:38 +00:00
Roy Marples
bf80d52682 Add -W, --whitelist addr/cidr
This only allows packets from the addresses listed and overrides
blacklist if set.
2009-07-05 11:33:46 +00:00
Roy Marples
a95ad17c17 Silence more GCC warnings about unused return values. 2009-07-04 00:58:03 +00:00
Roy Marples
d814868168 When we get an ACK we should close DHCP sockets so we don't handle any NAKs
during ARP testing.

This is important as some broken DHCP servers NAK immediately after an ACK
in some situations.
2009-07-04 00:06:25 +00:00
Roy Marples
acf27bef35 Style. 2009-06-09 19:11:33 +00:00
Roy Marples
3c12970b61 Although RFC2131 requires a ServerID we can actually work without one.
Some broken servers don't send a ServerID, so make the requirement optional.
We default to requiring ServerID in dhcpcd.conf though as some other broken
servers NAK incorrectly without a ServerID.
2009-05-13 19:17:21 +00:00
Roy Marples
83a5df4703 Fix dhcpcd -n $int starting a new instance of dhcpcd if not running. 2009-05-09 14:15:31 +00:00
Roy Marples
601fb3d500 Add (c) to Copyright 2009-05-01 13:57:45 +00:00
Roy Marples
3949692e4d Fix existing address detection. 2009-04-27 14:00:39 +00:00
Roy Marples
ff021b0b5d Add an option to fallback to a profile when DHCP fails. 2009-04-18 21:43:23 +00:00
Roy Marples
47681a7058 Fix compile on FreeBSD. 2009-04-17 13:42:44 +00:00
Roy Marples
572ccfb7e2 We should ignore DHCP messages without a ServerID, #166. 2009-04-12 19:16:57 +00:00
Roy Marples
6f767217f6 Add the ability to arping an address and select a profile based on the
hardware address replied with or the ip address.
2009-03-31 08:35:38 +00:00
Roy Marples
4a4bcf7cf5 Improve PTP INFORM support some more. 2009-03-23 22:02:37 +00:00
Roy Marples
a43ccb9f89 Default point to point interfaces to static if not inform.
Only accept inform replies from our destination address.
2009-03-23 20:10:02 +00:00
Roy Marples
727f6d386c Fail the interface when we need a clientid. 2009-03-23 11:15:35 +00:00
Roy Marples
45b51c7f6c dhcpcd CAN work on IEEE FireWire interfaces.
However, BPF does not appear to operate on these, so we report the error
and continue.
When BPF supports FireWire for DHCP, dhcpcd will magically start to work.
2009-03-23 10:09:10 +00:00
Roy Marples
da7e6aef0b We should handle SIGUSR1 correctly. 2009-03-20 10:33:09 +00:00
Roy Marples
373e6ce084 Add an option to reconfigure dhcpcd without rebinding.
This is primarily for interaction with 3rd party link management, such as PPP.
More work on #159.
2009-03-20 10:21:12 +00:00
Roy Marples
263e8fdd42 Move dhcpf.h into dhcp.h were it belongs 2009-03-19 22:45:57 +00:00
Roy Marples
048ab309bb Linux can now detect address addition and removal too. 2009-03-19 22:27:13 +00:00
Roy Marples
a89ac9ad96 Fix compile on Linux. 2009-03-19 19:17:34 +00:00
Roy Marples
1abffd5ba5 We can now detected primary addresses added or changed in BSD.
As such, we can wait for a 3RDPARTY to configure the interface, such as PPP.
We can then take the destination addess and automatically give it a default
route or any other DHCP option such as DNS servers.
This addresses #159.
2009-03-19 17:52:12 +00:00
Roy Marples
ce6b39df64 We need to blacklist IP addresses at the packet level
so we can ignore NAKs from rogue servers who don't
supply a ServerID, or supply a fake one.
2009-03-10 17:28:18 +00:00
Roy Marples
2f7cb97c9b Improve INFORM and STATIC support.
It's now possible to flip between DHCP, INFORM and STATIC on already
running instances.
2009-03-05 16:35:03 +00:00
Roy Marples
746e44f9c2 If we reboot an IPv4LL address, start DHCP negotiation right away. 2009-03-03 23:41:53 +00:00
Roy Marples
0ffa23aeb6 Set the interval to 0 when carrier comes up. 2009-03-02 23:24:34 +00:00
Roy Marples
e103c79fca Validate UDP better by ensuring data len is not bigger than our struct
and that the claimed length by the header is not greater than our length.
Thanks to Michael Olney.
2009-02-28 08:59:48 +00:00
Roy Marples
e095a6ebb5 Blacklist now accepts networks as well as addresses.
It also matches on the address offered as well as the server address.
2009-02-27 21:18:01 +00:00
Roy Marples
fd77df4b70 Stop enforcing a umask in dhcpcd.
Instead we will ensure that /etc/resolv.conf is 644.
Other config files will retain their existing umask or inherit the current one.
2009-02-25 14:59:27 +00:00
Roy Marples
e59105abf0 Don't timeout if we're daemonised. 2009-02-25 07:52:07 +00:00
Roy Marples
07911de972 Why bother with a one off array when we can use our eloop? 2009-02-24 19:17:19 +00:00
Roy Marples
379a2b4ba6 Close sockets better and just run the script when we're not touching the interface. 2009-02-24 15:41:15 +00:00
Roy Marples
3ec40a384b Fix starting all ifaces. 2009-02-24 13:26:28 +00:00
Roy Marples
acb1cf88cf Fix debug working in dhcpcd.conf 2009-02-23 23:52:21 +00:00
Roy Marples
cf6757c4d5 If we fail to send a packet we should still continue our code path.
Existing failure timers should change it if needed.
2009-02-20 08:33:03 +00:00
Roy Marples
62b44b4021 We should expire instead of stop as we will start again. 2009-02-20 07:29:13 +00:00
Roy Marples
8e96267bac If we fail to send a packet start over.
We should have our own array of interfaces to start, as
interface order could change or be removed during start_interface.
2009-02-19 21:15:25 +00:00
Roy Marples
2d775a6758 Only auto background with no interfaces. 2009-02-18 08:07:10 +00:00
Roy Marples
c9fc4ec4b9 If running as a controlling daemon with link management, background earlier. 2009-02-17 23:02:09 +00:00
Roy Marples
3c3f38c090 Allow socket to report location of the configuration file. 2009-02-13 15:39:34 +00:00
Roy Marples
eab2229cfa Enforce NetBSD KNF style more 2009-02-11 17:56:22 +00:00
Roy Marples
63170def69 Log our control commands. 2009-02-05 21:06:57 +00:00
Roy Marples
c2189713b5 RFC2131 implies that we should only ARP check after an offer. 2009-02-01 17:13:19 +00:00
Roy Marples
de82635c04 We should zero the entire message struct so any options don't overflow into unallocated memory when evaluating them. 2009-01-30 20:18:35 +00:00
Roy Marples
4ac6a5d2f9 Just terminate the DHCP message if not terminated. DHO_PAD could be valid data. 2009-01-29 13:56:23 +00:00
Roy Marples
141c809224 Shorten error msg. 2009-01-29 13:18:57 +00:00