Commit Graph

98 Commits

Author SHA1 Message Date
Roy Marples
c8b42ae14d Compile and work on OpenBSD.
However, there is a problem deleting both IPv4 and IPv6 subnet routes.
Also, there is a problem opening a BPF fd in non blocking mode directly and
posix_spawn(3) fails to work so we block that in configure.
2014-03-05 18:11:22 +00:00
Roy Marples
e57635123f Sanitize some gcc options in -Wall.
Remove -fno-common.
Move embedded dhcpcd configuration to from data segment to text.
2014-03-04 13:12:07 +00:00
Roy Marples
91da35ce43 To avoid any future problems, log the TARGET we dervive the OS from. 2014-03-04 10:02:58 +00:00
Roy Marples
b3574a2516 Just make the configure a bit easier. 2014-03-03 17:25:28 +00:00
Roy Marples
cb8d2c35cc Fudge deriving os from Debian style 2014-03-03 15:48:07 +00:00
Roy Marples
738e7820b0 We shouldn't need this anymore 2014-03-03 14:06:27 +00:00
Roy Marples
ef3e8195fe Work better with autoconf build host 2014-03-02 08:36:19 +00:00
Roy Marples
0f9e1ee7f8 Don't set CC, always let the environment choose 2014-02-28 14:53:26 +00:00
Roy Marples
a9d78def54 Remove DEBUG_MEMORY guard and always free memory and resources.
Remove all atexit(3) and exit(3) calls, instead exiting via the eloop.
2014-02-04 14:39:26 +00:00
Roy Marples
dfeba51391 We don't want to show cc errors here 2014-02-03 17:29:36 +00:00
Roy Marples
1131df84d5 Only link to libmd if it lives in /lib 2014-02-03 13:24:04 +00:00
Roy Marples
90ada440ec Fix make import with compat sources.
Use -lmd for MD5 if available.
2014-02-03 13:09:13 +00:00
Roy Marples
b1aadc616e Tweak stuff for importing 2014-01-31 15:55:16 +00:00
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