Commit Graph

37 Commits

Author SHA1 Message Date
Roy Marples
109146e29e Rework if_address to just use an ipv4_addr structure, similar to how
if_address6 works.
Use a pointer to the ipv4_addr for the address we added for dhcp and ipv4ll
states.
This is quite some churn throughout the IPv4 stack, but makes the
binary smaller (at least on Linux/amd64).
It will be needed to support adding addresses on Solaris.
2016-05-18 16:23:28 +00:00
Roy Marples
ea3c0d5105 Allow arp_open to be called publically. 2016-04-29 22:42:48 +00:00
Roy Marples
cb1bbd36ff RFC 3927 Section 2.5 says a defence of an address should ARP announce it.
This is unicast, whereas the default kernel action is to unicast a stock
reply, so the client that tried to claim the address will receive two replies.

Fixes [a19bb0eae6].
2016-04-20 08:29:08 +00:00
Roy Marples
c477e2458f Add an free callback to ARP states so that they can notify their parents they
are gone to avoid any double frees.
Fixes [5fdd9b8d08].
2015-06-25 15:36:28 +00:00
Roy Marples
ba251d82a5 Move ARP state out of DHCP. 2015-06-19 14:01:25 +00:00
Roy Marples
dc1979d932 Improve IN_IFF_TENTATIVE with ip sharing. 2015-05-16 20:42:05 +00:00
Roy Marples
d686aa4f7d Support IN_IFF_TENTATIVE and IN_IFF_DUPLICATED on NetBSD. 2015-05-01 09:41:54 +00:00
Roy Marples
bb5825b3e2 Let arp_new take an address so we never have duplicate
ARP states.
2015-05-01 08:10:16 +00:00
Roy Marples
f9584c9506 Update copyrights to 2015. 2015-01-02 20:03:28 +00:00
Roy Marples
ca867830ab Fix compile warnings without INET or INET6 using gcc. 2014-12-21 19:00:19 +00:00
Roy Marples
121e7ec9a2 Fix build without INET 2014-12-18 11:47:09 +00:00
Roy Marples
751f8fcba1 Free other ARP states in a better way. 2014-10-24 19:30:24 +00:00
Roy Marples
741dbf636d Improve IPv4LL -> DHCP state transitions 2014-10-24 11:00:03 +00:00
Roy Marples
c4563942ab Add a helper function to report conflicts to shrink the binary. 2014-10-23 19:58:36 +00:00
Roy Marples
1d5d236a81 Rework the ARP code so that we can have multiple ARP states.
Split the ARP resolution code to dhcp or ipv4ll where it belongs.
This allows us to probe IPv4LL while still DISCOVERing a DHCP lease.
2014-10-23 19:07:35 +00:00
Roy Marples
10dc667cab Changed in 2014 2014-01-31 12:45:55 +00:00
Roy Marples
c6eb161be2 Implement support for RFC 3203, FORCERENEW message. 2014-01-31 11:47:27 +00:00
Roy Marples
dea2d67376 Note that we support RFC 5227 2013-04-05 09:47:33 +00:00
Roy Marples
8cc47ba26d White space police 2013-04-04 20:31:04 +00:00
Roy Marples
294eff4df4 Remove IPv4 and DHCP4 specific setup from dhcpcd.c and move into ipv4.c
and dhcp.c
Split configure.c into script.c and move the rest into dhcp.c

This starts the goal of making the base of dhcpcd protocol agnostic and
working towards building IPv4 and/or IPv6 code only to reduce size and
allow growing any future new protocol easier.
2013-02-02 14:05:55 +00:00
Roy Marples
601fb3d500 Add (c) to Copyright 2009-05-01 13:57:45 +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
f43e585355 Add a control socket so that interfaces can be dynamically re-set.
This requires the event loop argument being changed to void *
so we can send arguments other than an interface.
2008-09-03 16:49:28 +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
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
Roy Marples
a9819bfb1f Split interface and socket out into OS bpf, if-bsd and if-linux. 2008-03-24 01:29:33 +00:00
Roy Marples
8d21242476 Change code style to match the BSDs in the hope the might adpot it instead of dhclient. 2008-03-20 16:47:51 +00:00
Roy Marples
782830eb5d Belatedly into 2008 :) 2008-01-08 09:51:23 +00:00
Roy Marples
b6057d10d2 Re-license as 2-clause BSD as I've re-written everything from the old dhcpcd-2 code base now. 2007-11-15 11:35:53 +00:00
Roy Marples
1f8f3dbdc1 Reword the headers to just say we use the GPLv2. 2007-11-07 16:26:41 +00:00
Roy Marples
cfe160119d Update my e-mail address as I have retired from Gentoo. 2007-11-06 15:03:38 +00:00
Roy Marples
77659ce035 We now do ARP checking by default as recommended by RFC 2131.
Add RFC 3927 (aka IPV4LL aka APIPA) support by default.
2007-07-18 11:26:59 +00:00
Roy Marples
4549f7a4dd config.h now has the compile time options, instead of being dotted around.
Added -E option, which reads the last info file and uses the information there
if we timeout and the lease is still valid, thanks to Roberto Angelino.
2007-05-10 09:39:26 +00:00
Roy Marples
3d19de577b For infinite timeout, we now resent the last request at TIMEOUT_MINI
intervals like we do otherwise.
We now return a non zero exit code on SIGTERM and SIGINT if we have not
forked into the background.
When NIS and/or NTP servers are updated, we restart the service for them
if we can.
2007-01-16 17:54:07 +00:00
Roy Marples
d3e2c11ab4 Make the consts sane 2006-12-14 23:47:56 +00:00
Roy Marples
262fe7db60 Add loads of debugging CFLAGS so we can remove all compiler warnings 2006-12-14 23:17:27 +00:00
Roy Marples
cced195e70 Add dhcpcd-3 re-write 2006-11-27 20:23:22 +00:00