Commit Graph

92 Commits

Author SHA1 Message Date
Roy Marples
af63ad90d6 When adding or changing routes, always supply IFP and IFA so we match
kernel messages 100%.
Restore purging kernel IPv6 routers.
2013-06-19 09:36:52 +00:00
Roy Marples
1f4c1525a5 Purge prefix list and routers at start of IPv6 for BSD.
Remove link_addr compact function as we now had a LL address list.
Fix INET and INET6 seperate compiles.
2013-06-10 00:56:54 +00:00
Roy Marples
e619948557 Keep state of delegated addresses
Handle RTM_NEWADDR messages a little better
Delete addresses with pltime of 0
2013-06-04 13:39:02 +00:00
Roy Marples
c2ae21d761 Fix compile on FreeBSD 2013-06-02 10:51:20 +00:00
Roy Marples
e59ebd3610 Fix an alignment error. 2013-05-31 15:18:52 +00:00
Roy Marples
fefc5353f3 Use LINK_UP/DOWN instead of magic numbers 2013-05-30 07:51:02 +00:00
Roy Marples
c5d2e393a5 Move SIOCGIFAFLAG_IN6 into if-bsd as in6_addr_flags
Add pfx_flush to flush ND6 entries when changing routes.
Both these functions only work for BSD, just stubs on Linux.

This tidies the code a little and fixes changing IPv6 routes on BSD,
although the kernel may complain network is down for a few moments.
2013-05-30 05:38:21 +00:00
Roy Marples
873c6af120 FreeBSD isn't buggy with adding new addresses and working out
if they are new and should be tentative - it was my buggy configuraion
when I upgraded from FreeBSD 8 -> 9.
2013-05-23 09:55:52 +00:00
Roy Marples
4c80d49c44 Fix compile on FreeBSD
Document why we don't set IN6_IFF_TENTATIVE when adding addresses
and a possible error on FreeBSD.
2013-05-22 18:16:32 +00:00
Roy Marples
5331b839c9 Store IPv6 link local addresses per interface.
Listen to kernel messages to account them.
If we don't have a local link address, delay IPv6RS as it just
won#t work until we have a local link address.
2013-05-17 23:09:36 +00:00
Roy Marples
5fe587be91 Test BSD kernels for a specific version so we can listen to either
RTM_NEWADDR for duplicates, or directly on the wire with a maximum
timeout.

Warn about this noisily as there is no reason why the kernel cannot be
easily patched to support this.
2013-05-16 14:28:42 +00:00
Roy Marples
d8194bcd39 Check address flags for tentative and duplicates bits for sanity.
Handle the actual trigger to callout dhcpcd-run-hooks in the DAD callback
instead of on receipt of RTM_NEWADDR directly. This is more code, but it allows
us to use our own DAD engine if we need to.
2013-05-16 10:31:21 +00:00
Roy Marples
a8df1b28fb Use the kernel DAD for IPv6 addresses and finish the action once each
address DAD completes. BSD kernels will require a patch as noted within
the README. The linux netlink part still needs to be written.
2013-05-15 10:27:36 +00:00
Roy Marples
66fd5d67f0 Add IPv6 DAD detection.
Sadly, it seems that userland cannot send from the unspecified address.
This means that for RFC conformancy, we have to rely on the kernel
performing DAD.
2013-05-03 12:11:49 +00:00
Roy Marples
3491ea4d56 Change from _unused to __unused to match NetBSD cdefs and avoid
a compiler failure on linux-headers-3.7
2013-04-24 09:38:18 +00:00
Roy Marples
8cc47ba26d White space police 2013-04-04 20:31:04 +00:00
Roy Marples
673e81e5b7 White space brigade 2013-04-02 07:01:11 +00:00
Roy Marples
7dab081fbe Add the noalias directive to so that when adding an IPv4 addresss
dhcpcd will overwrite a pre-existing address.

NetBSD PR/47699
2013-03-27 16:36:56 +00:00
Roy Marples
f7acdb2007 Fix compile on BSD 2013-02-19 15:28:21 +00:00
Roy Marples
969527cdec Fix compile. 2013-02-16 13:25:31 +00:00
Roy Marples
68ceb7004a Fix compile on BSD 2013-02-04 14:12:48 +00:00
Roy Marples
e54dee19ba Implement the core DHCPv6 client for SOLICIT, REQUEST, RENEW, CONFIRM. 2012-11-06 23:40:15 +00:00
Roy Marples
3a83f8aced Fix compile fr systems without RTF_CLONING such as FreeBSD-8 2012-10-24 12:59:20 +00:00
Roy Marples
eebe9a1887 Improve IPv6 RA support by allowing dhcpcd to manage the address and routes
instead of the kernel. dhcpcd will only do this if RA is disabled in the kernel
or dhcpcd has been instructed to do this via dhcpcd.conf(5) ipv6ra_own and
ipv6ra_own_default directives.

Send and process IPv6 Neighbor Solicitions and Adverts to prove router
reachability. If a router cannot be reached in this way then it is expired.

When debugging, all ND messages are displayed which will create a lot of log
spam.

To ease packaging, ./configure now accepts LDFLAGS and --enable-static.
2012-07-05 16:37:41 +00:00
Roy Marples
ae20b7ddab Simplify API a little. 2012-03-27 19:01:49 +00:00
roy@uberlaptop.marples.name
dcc1e564e7 Fix some valgrind errors on FreeBSD 2012-03-27 16:30:33 +00:00
Roy Marples
159cb2e6cf Fix carrier handling on BSD for interfaces that don't support link status 2012-01-31 16:32:10 +00:00
Roy Marples
7ae411d942 Fix more copyright 2012-01-31 09:51:12 +00:00
Roy Marples
c06ded74b2 Stop trunctating netmask sockaddr 2012-01-30 20:11:47 +00:00
Roy Marples
75092c2373 Optimize bitwise useage a little. 2011-11-23 11:59:53 +00:00
Roy Marples
e896947f2c Fix bitwise logic 2011-11-23 10:53:53 +00:00
Roy Marples
5f3b570cfd Fix carrier handling on BSD 2011-11-23 09:57:34 +00:00
Roy Marples
126abb55cf Respect each kernel message on carrier change instead of checking carrier
after receiving the message as it's possible for the kernel to react faster
than dhcpcd.
2011-11-23 09:03:24 +00:00
Roy Marples
eb99814091 2011 and new version. 2011-02-04 14:56:03 +00:00
Roy Marples
b92c960fe0 Use RT_ROUNDUP and friends so that we work with NetBSD 64-bit routing. 2011-02-04 14:43:51 +00:00
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