Commit Graph

57 Commits

Author SHA1 Message Date
Roy Marples
64bc759d08 Compile on Mac OSX 10.4.
Thanks to David Brownlee.
2010-12-06 15:01:56 +00:00
Roy Marples
8349d72adf Support RTM_CHGADDR in NetBSD-6 for detecting link layer address changes. 2010-11-12 16:33:45 +00:00
Roy Marples
029821afa1 Use a dynamic buffer for managing link messages. 2010-07-21 20:45:41 +00:00
Roy Marples
7b6f803e29 These files were updated in 2010, so fix copyrights. 2010-06-04 08:33:16 +00:00
Roy Marples
d274a5320b Set the broadcast flag for interfaces that say they need it. 2010-03-05 15:47:46 +00:00
Roy Marples
255e14dab1 Enable net.ipv4.conf.$iface.promote_secondaries on Linux so that
we keep the subnet when changing addresses on the same subnet.
2010-02-26 20:37:30 +00:00
Roy Marples
8ab2df96b1 Just have one open socket for AF_NET. 2009-10-15 00:30:54 +00:00
roy@ubersparc.marples.name
2397b7e4fa We need to cast to void * to remove warnings on Sparc64 2009-05-02 16:21:52 +00:00
Roy Marples
601fb3d500 Add (c) to Copyright 2009-05-01 13:57:45 +00:00
Roy Marples
9d5fe47f45 Fix compile on NetBSD 2009-04-17 13:31:41 +00:00
Roy Marples
5ed586386c discover_interfaces now uses getifaddrs instead of OS specific implementation.
do_interface then becomes do_address and also uses getifaddrs.

Binary size is a little smaller, code size is now a lot smaller.
2009-04-17 12:49:25 +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
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
194b1fcb08 Fix compile on DragonFly.
Thanks to Hasso Tepper.
2009-03-18 21:16:33 +00:00
Roy Marples
a4f6339ebd We shouldn't need to flush arp entires ourself on BSD platforms. 2009-03-11 11:53:11 +00:00
Roy Marples
81174c4b96 Remove compile warnings on Sparc64 2009-02-26 11:12:23 +00:00
Roy Marples
eab2229cfa Enforce NetBSD KNF style more 2009-02-11 17:56:22 +00:00
Roy Marples
146d8134bd Fix compile on BSD. 2009-01-27 19:40:05 +00:00
Roy Marples
fa344ba2b1 Add route removal detection to Linux.
This involved a rejig of the socket code so we can detect
if we removed the route or not.
2009-01-27 18:09:02 +00:00
Roy Marples
16687a3be1 We need to ensure that manual route deletions are deleted from our internal routing table also. Partial fix for #159. 2009-01-26 22:32:42 +00:00
Roy Marples
fcdf05ed93 Adding subnet routes with just sdl_index set does not work for FreeBSD. 2009-01-02 09:31:42 +00:00
Roy Marples
63a4a61b1d Fix getting ssid. 2009-01-01 21:31:49 +00:00
Roy Marples
c53cf4ef4b You can now add a configure block per ssid if the interface is wireless. 2009-01-01 20:51:04 +00:00
Roy Marples
e346dd7ccc Try and make the subnet route identical to the kernel one. 2008-12-13 09:40:27 +00:00
Roy Marples
a4d0de41b3 Don't delete static ARP entries 2008-12-01 20:18:02 +00:00
Roy Marples
a6fc352dde Ensure host routes and subnet routes are added correctly. 2008-12-01 16:58:10 +00:00
Roy Marples
6abfc8ec05 Style 2008-11-25 11:39:09 +00:00
Roy Marples
3ad4d331af Fix some LINT errors. 2008-11-10 11:15:27 +00:00
Roy Marples
eae4f5b472 Get INFORM support almost working again. 2008-10-18 16:41:19 +00:00
Roy Marples
a6fa5cfde8 Fix warning on sparc64 2008-10-17 07:22:39 +00:00
Roy Marples
674616cd83 Cast to void * to avoid compiler warnings on Sparc64. Also, save a needless malloc. 2008-10-15 13:00:33 +00:00
Roy Marples
dacb4c85c2 Compile on Sparc64/FreeBSD-6.2 2008-10-15 09:08:22 +00:00
Roy Marples
f52769ba71 Move wireless detection from net.c into if-bsd.c and if-linux.c 2008-09-17 10:32:55 +00:00
Roy Marples
12653e1643 Fix discovery 2008-09-16 10:02:14 +00:00
Roy Marples
43b2edaf43 Move AF_LINK discovery to if-bsd.c. Also, we only work with IFT_ETHER types currently, so skip others. 2008-09-16 09:55:46 +00:00
Roy Marples
facdc25be0 Remove debug. 2008-09-15 19:30:44 +00:00
Roy Marples
afc7387846 We need to flush the ARP table after configuring new routes. 2008-09-15 19:15:52 +00:00
Roy Marples
43205146f8 Fix subnet routes. This needs more testing. 2008-09-15 09:05:29 +00:00
Roy Marples
3b85adad85 Ensure that routes go via the correct interface and set netmask correctly. 2008-09-14 09:07:34 +00:00
Roy Marples
441f7d159d Remove remembering routes per interface and have a global routing table so we can change routes depending on interface state. This is very useful for the BSD's where there is no route metric. 2008-09-12 18:08:07 +00:00
Roy Marples
2b60ecb71e Sort interfaces according to preference and pass this to dhcpcd-run-hooks so we can prefer configs. 2008-09-09 17:07:48 +00:00
Roy Marples
62111255dc Fix compile. 2008-09-04 14:12:20 +00:00
Roy Marples
064dd58ee2 Enable detection of addition and removal of interfaces on Linux. 2008-09-04 14:08:14 +00:00
Roy Marples
96d0673a2c When OS reports new and removed interfaces, dhcpcd sees this and either starts or stops watching them. BSD only, Linux to follow. 2008-09-04 11:30:11 +00:00
Roy Marples
87987af44e Not needed. 2008-09-04 09:43:33 +00:00
Roy Marples
fd05b7dcfc Add an event loop.
Split client.c into smaller files and functions and
recode around the event loop.
Add multiple interface support using the new event loop.
Document changes and outstanding bugs.
2008-09-02 13:28:11 +00:00
Roy Marples
a26af49123 Add support for link carrier detection. For Linux this involved a big change to the netlink code to add callbacks, for BSD just an extra function. We also have an option not to wait for a DHCP lease and fork right away - useful for startup scripts. 2008-07-16 22:23:07 +00:00
Roy Marples
fca9d5445b Style. 2008-05-15 15:48:15 +00:00
Roy Marples
f2cfcde87e Our ctype calls should always use unsigned. 2008-04-17 09:57:19 +00:00
Roy Marples
1a60d14fa2 Normally I hate massive code drops, but heh.
The code has been drastically re-arranged.
Instead of populating a custom structure while parsing dhcp messages, we now pluck what we need right out of the message itself. We have custom functions and a lookup table to make this really easy.
This makes us more like dhclient and udhcpc, and will enable us to easily add (and remove!) more dhcp options without having to actually change the code (much).
We now store the real dhcp message we got in /var/db/dhcpcd-$iface.lease, the mtime of the file being used as when we got the lease. This file is read in when re-using an old lease instead of parsing the .info file.
The benefit of all of this means that we're actually ~15k smaller when compiled with the same features.
This has been tested for quite some time, and I'm pretty sure most bugs with the 3.2 branch have been fixed whilst making this. Right now, we are 99% command line compatible with the 3.2 branch.
2008-04-11 16:14:55 +00:00