Commit Graph

85 Commits

Author SHA1 Message Date
Roy Marples
7451badfe6 Fix compile on NetBSD 2014-01-25 02:50:27 +00:00
Roy Marples
c73ed17160 Implement RFC 1321 MD5 Message-Digest if not provided in libc.
Implement RFC 2104 HMAC Keyed Hashing.

Implement RFC 3118 Authentication for DHCP Messages
and RFC 3315 Authentication options.
2014-01-25 01:35:53 +00:00
Roy Marples
c19ee2be35 Modern init systems such as OpenRC and systemd can be installed on top
of the base system init.
However, the user can easily flip between them so we need to work out
which init system is in use at runtime rather than compile time.
2014-01-08 11:34:51 +00:00
Roy Marples
b3c55f23df Change configure to detect fossil for debugging.
Make dist now exports the current fossil checkin.
Remove old .git files.
2014-01-03 17:16:12 +00:00
Roy Marples
ae4e592fa2 Remove hard coded DHCP/DHCPv6 options and then to dhcpcd-definitions.conf
This file replaces dhcpcd-embedded.conf
This actually results in a slightly smaller binary than before and has the
added advantage that the option definitions are now all held within one file.
2013-12-02 16:42:09 +00:00
Roy Marples
0adc150afe Style 2013-11-29 18:41:02 +00:00
Roy Marples
855ad5e356 -g is more portable than -ggdb 2013-11-29 18:38:25 +00:00
Roy Marples
571fa5e18c initial define lengths are calculated during the make phase 2013-11-29 17:10:10 +00:00
Roy Marples
1cd05a96d5 Read the embedded config into global values rather than each time
per interface.

Add config toggles to build dhcpcd-embedded.conf into dhcpcd or
to read it at runtime. The build process will now build .c and .h
files based on dhcpcd-embedded.conf and provide defines to reduce
the number or re-allocs if it grows (ie has the full DHCP option list).
2013-11-29 11:15:03 +00:00
Roy Marples
1d762670d2 Fix debug options and default CFLAGS 2013-11-27 21:14:19 +00:00
Roy Marples
8e7d8c37a4 Add support for user defined options with embedded and encapsulated options.
Install dhcpcd-embedded.conf to LIBEXECDIR which is read before dhcpcd.conf.

The idea is that this dhcpcd-embedded.conf is maintained only by me to support
RFC DHCP/DHCPv6 options that require known embedded or ncapsulated options
which are not easily added to our option structures in dhcp.c and dhcp6.c.
Eventually we may move the whole structure here so that a smaller binary
is produced and the definitions are easier to maintain.
2013-11-27 20:21:17 +00:00
Roy Marples
2e9244794f Set blank CFLAGS/CPPFLAGS and then append user CFLAGS/CPPFLAGS.
This allows us to pass them to the configure tests and keep our
sed to extract them portable.
2013-11-10 11:17:40 +00:00
Roy Marples
587b9b7f74 Fix typo adding CPPFLAGS to XCC.
Thanks to Michael Forney.
2013-11-10 10:32:01 +00:00
Roy Marples
077eb0643c It seems that some older udev versions support filtering but not
per device initialization checks.
Add a test for this.
2013-09-12 21:43:17 +00:00
Roy Marples
b4a7edc395 Dev module start now returns an fd to monitor so the eloop additions
can go into dev.c
Create a new struct to pass dhcpcd handle_interface to dev plugins
This allows us to build the dhcpcd binary normally and save a few k
disk space.
2013-09-12 21:13:41 +00:00
Roy Marples
2ecb5dca81 Fix dev building again 2013-09-12 17:16:51 +00:00
Roy Marples
52dc01927b Fix building with a dev manager 2013-09-12 17:08:34 +00:00
Roy Marples
a68c246036 Support older udev versions where we need to rely on udev-settle. 2013-09-12 16:46:41 +00:00
Roy Marples
413652c1b3 Instead of linking directly to libudev, create a plugin system for /dev
management. This allows dhcpcd to work even if udev removed and adds the
ability to change from udev to something else in the future.
2013-09-12 15:43:20 +00:00
Roy Marples
324470122f Fix udev filter test. 2013-09-09 16:28:05 +00:00
Roy Marples
12bbc8cb5c Add udev support for interface arrival and departure.
This is because udev likes to rename the interface, which it can't
do if dhcpcd grabs it first.
2013-09-09 16:14:06 +00:00
Roy Marples
e82129a42c Reduce code size by merging IPv6 ND with RS. 2013-08-20 10:29:43 +00:00
Roy Marples
a045e9909d Slackware uses /etc/rc.d/rc.$service instead of just $service,
so configure doesn't find those. This patch overrides the
defaults for SERVICEEXISTS, SERVICECMD, and SERVICESTATUS.
Thanks to Robby Workman.
2013-08-02 09:10:38 +00:00
Roy Marples
64fd75d9a9 Incase CFLAGS is set, we should still set std 2013-06-25 09:04:10 +00:00
Roy Marples
400f3515aa Add RCSID and CVS headers when importing to NetBSD. 2013-06-20 10:35:16 +00:00
Roy Marples
779ffd439d Restore linkaddr compat support for KFreeBSD 2013-06-19 09:17:15 +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
8923da70c5 Prefer --prefix over $PREFIX 2013-06-06 00:31:00 +00:00
Roy Marples
1201c50ede Fix configure --without-pollts 2013-03-26 10:48:28 +00:00
Roy Marples
cb11792598 Fix compile on Linux. 2013-02-18 21:45:19 +00:00
Roy Marples
d628ebf7db Complete transition to pollts(2) 2013-02-18 21:35:24 +00:00
Roy Marples
237e8234a7 Change from ppoll(2) to pollts(2).
I was going to go with ppoll(2) because I would guess the Open Group
would prefer the name of it over pollts(2) if they ever standardised it.
However that causes a problem with _GNU_SOURCE and my code base so I've
gone to pollts(2) and suck in the compat header for Linux users to avoid
that sillyness.
2013-02-18 21:25:07 +00:00
Roy Marples
e6d2517562 Rework our signal setup and event loop around ppoll(2).
ppoll is mapped to pollts(2) for supporting systems.
If pselect(2) is available then we provide a compat shim for that, otherwise
we provide a non race free shim based on poll(2).
2013-02-18 20:56:55 +00:00
Roy Marples
cebe222c56 Add -h|--help option to configure 2013-02-15 20:07:26 +00:00
Roy Marples
aae24feb3d It's now possible to compile out IPv4 and IPv6 support by passing
--disable-ipv4 or --disable-ipv6 to configure.
2013-02-04 13:30:35 +00:00
Roy Marples
31389eea99 Improve logging of script exiting. 2012-11-11 12:19:19 +00:00
Roy Marples
34a7563e0f Add a pselect(2) shim for systems that lack support for it.
When building, warn that it's not entirely race condition safe.
2012-11-10 16:38:53 +00:00
Roy Marples
5c08c0c4ca Replace poll(2) with pselect(2) and vfork(2)+execve(2) with
posix_spawn(3).
Now we block all our signals at startup and allow pselect to
unblock them for the duration of the call. This allows us to
manage interrupts in a fashion to guarantee a consistent
internal state.

I have added a posix_spawn compat shim for systems that lack
that call. pselect(2) has been supported on target for some time
so there is no need for a compat shim there.
2012-11-10 16:38:52 +00:00
Roy Marples
8be43c978b whitespace 2012-10-31 20:17:59 +00:00
Roy Marples
6855bff4c4 Provide TAILQ_FOREACH_REVERSE_SAFE if not defined.
When removing routes, do it in reverse order.
2012-10-31 20:14:08 +00:00
Roy Marples
f29cbe614f Fix code for -Wstrict-overflow 2012-10-12 11:26: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
7a33435054 Change system services warning to match as autoconf.
Thanks to Gilles Espinasse.
2012-04-21 17:18:14 +00:00
Roy Marples
7e82ec4449 Fix configure test for arc4random on FreeBSD 7 2012-02-04 14:25:11 +00:00
Roy Marples
0e18128ad8 Default back to gcc as it seems clang isn't good for powerpc. 2012-02-02 23:30:13 +00:00
Roy Marples
efaacbbf18 Add and prefer clang to the compiler list.
The compiler version is now shown during configure.
2012-01-24 11:26:20 +00:00
Roy Marples
5cbb26a03b Shell portability fixes 2011-06-01 06:28:41 +00:00
Roy Marples
8d8555b6a6 Fix Arch Linux SERVICESTATUS override.
Thanks to Clemens Fischer.
2011-05-22 06:19:33 +00:00
Roy Marples
4c757a5919 Respect $SED 2010-11-04 09:12:14 +00:00
Roy Marples
7c3dbf074e Another kFreeBSD fix. 2010-10-27 14:17:21 +00:00