Commit Graph

158 Commits

Author SHA1 Message Date
Roy Marples
f94b4eab06 Use strtoi(3) and strtou(3) from NetBSD-8 instead of the harder to use
strtol(3) calls.
Add shims around strtoimax(3) and strtoumax(3) when these functions
are not available.
2015-01-31 01:02:07 +00:00
Roy Marples
2179b718aa OpenBSD fixed their posix_spawn(3) implementation in 5.7 2015-01-05 14:12:23 +00:00
Roy Marples
2360efb8cf Add qnx* to OS detection so we can pass the __EXT define and stay using
--cstd=c99.
2014-12-23 09:46:02 +00:00
Roy Marples
71d20c8a12 Fix compile on QNX. Thanks to Will Miles. 2014-12-20 14:11:38 +00:00
Roy Marples
c6c54d9e96 Include linux/rtnetlink.h in config.h rather than each file that needs it.
Detect RTM_NEWNEIGH rather than force a define based on __linux__.
2014-12-10 22:42:12 +00:00
Roy Marples
cf2469a152 If we don't include sys/queue.h directly the clang analyzer complains
about using freed memory.
That seems to be a workaround for this upstream bug:
http://llvm.org/bugs/show_bug.cgi?id=18222
2014-11-11 10:33:28 +00:00
Roy Marples
e3159b9cc0 Align config.h contents better 2014-11-11 10:02:17 +00:00
Roy Marples
bc09d81de2 TAILQ is now inlcuded via config.h either via sys/queue.h or compat/queue.h.
This allows dhcpcd to compile on systems that do not even supply sys/queue.h,
such as the musl C library.

Thanks to Juan RP.
2014-11-10 16:56:32 +00:00
Roy Marples
68c8a3cf6f Remove RCSIDs from dhcpcd, they belong in the upstream project only. 2014-11-07 20:56:47 +00:00
Roy Marples
91692ea1c7 Improve FreeBSD support by using the actual AF_LINK address. 2014-10-10 20:35:13 +00:00
Roy Marples
8f008ca7f5 Remove vis based encoding - instead expand the DHCP option encoding to a
natural string based on content except as noted:
  *  domain (RFC3397)/dname (string) is strict domain name allowance
     (ie, [alnum] with _- (but not at the start or end))
  *  string is now printable ascii (1-127) until invalid
  *  ascii is all ascii (1-127) until invalid
  *  raw is all chars (1-255) until NUL
  *  binhex is a hex representation of the option including embedded NULs
  *  ssid is still escpaed octal because it's expected to be human readable
     AND can technically be all NUL
  *  everything else has strict option -> value encoding

This removes all shell escaped encoding - dhcpcd will assume that IF the
--script option is a shell, it will quote variables correctly.
The stock dhcpcd-run-hooks does.

dhcpcd -V now prints how the variables will be decoded.

Changed some options in dhcpcd-definitions.conf to more sensible defaults.
2014-10-01 18:32:03 +00:00
Roy Marples
5b0c4877d5 We only supply svis(3) so rename the files as such. 2014-09-27 00:12:21 +00:00
Roy Marples
c7d3d69b81 Clean up configure _vis files 2014-09-26 23:20:35 +00:00
Roy Marples
4f2199843d Sanitise the following characters using svis(3) with VIS_CTYLE and VIS_OCTAL:
| ^ & ; < > ( ) $ ` \ " ' <tab> <newline>
This allows a non buggy unvis(1) to decode it 100% and stays compatible with
how dhcpcd used to handle encoding on most platforms.
For systems that supply svis(3) there is a code reduction, for systems that
do not, a slight code increase.

This change mitigates systems affected by bash CVE-2014-6271 and CVE-2014-7169.
2014-09-26 20:07:07 +00:00
Roy Marples
be111d4b71 Fix configure errors without pkg-config installed. 2014-09-22 13:57:58 +00:00
Roy Marples
b7e48083a6 Only hunt for a cross compiler if build != host. 2014-09-21 20:09:25 +00:00
Roy Marples
e5166f23ce Revert faulty patch 2014-09-21 20:05:20 +00:00
Roy Marples
f1d3f20c9c Only hunt for a cross compiler if build != host. 2014-09-21 20:01:53 +00:00
Roy Marples
782564885d Redirect fd 3 to config.log.
Redirect all CC errors to fd 3.
2014-09-21 11:39:02 +00:00
Roy Marples
1304ce8127 Check that CC works after applying all our CPPFLAGS and CFLAGS as one
of them might stop CC from working.
2014-09-21 10:28:54 +00:00
Roy Marples
ba17076058 Add _DEFAULT_SOURCE #define to linux builds so glibc-2.20 stops bitching about _BSD_SOURCE 2014-09-18 09:06:51 +00:00
Roy Marples
f7d83c0dfc It's possible to configure a Linux kernel with nl80211 where the
SSID won't be reported, but is available via WEXT.
This is very silly, but dhcpcd still needs to work.
Thus enable both protocols and use nl80211 if WEXT fails.
2014-09-15 23:05:20 +00:00
Roy Marples
387fde080c Fix nl80211.h test 2014-09-10 08:40:06 +00:00
Roy Marples
ffb70eff16 Fix arc4random_uniform test.
Rename if-linux-wireless.c to if-linux-wext.c to better reflect it's purpose.
2014-09-10 02:22:18 +00:00
Roy Marples
67ed6c5fdc Use the nl80211 interface on Linux to get the wireless SSID.
If this is not found in the system headers, fall back to assuming WEXT.
This has been done because the WEXT module has been marked as deprecated
for a while now and I'm getting bored of people asking me why their
wireless wasn't working. Bloated dhcpcd by another 600 bytes as a result.
2014-09-10 01:46:58 +00:00
Roy Marples
01890c79df Split arc4random_uniform into it's own compat function and add
it's proper copyright.
Add a new test for it to configure so that we can use the
uclibc arc4random function and our compat arc4random_uniform function.
2014-09-07 17:24:07 +00:00
Roy Marples
5c9c7e301b Fix the import to work on Linux as well. 2014-07-30 09:46:33 +00:00
Roy Marples
13b53e5ac4 Fix fallback test 2014-07-05 15:40:01 +00:00
Roy Marples
775739c502 Revert [26bc10be24] as some compile can't output to /dev/null. 2014-06-30 09:44:07 +00:00
Roy Marples
5e8e0b721e Simplfy configure CC test. Thanks to Thomas De Schampheleire. 2014-06-22 10:06:53 +00:00
Roy Marples
67dcaaa4dd Test that the CC command works and makes an exectuable rather
than using the type command.
Thanks to Thomas De Schampheleire.
2014-06-21 15:46:31 +00:00
Roy Marples
f3bc4056ea Allow the use of libmd in static or /usr builds 2014-06-05 17:42:21 +00:00
Roy Marples
9fe278633a Remove test files 2014-06-05 14:21:27 +00:00
Roy Marples
626462a5d0 Fix be64enc test on NetBSD. 2014-06-05 13:56:16 +00:00
Roy Marples
21350faddd Fix configure 2014-06-05 13:54:38 +00:00
Roy Marples
6c9c458324 be32enc is missing on OpenBSD, so provide a configure test.
Fix compile on OpenBSD.
2014-06-05 13:53:20 +00:00
Roy Marples
5da48f00a7 Fix compile on Linux 2014-06-02 17:10:13 +00:00
Roy Marples
45a33d2f3e Use SHA256Init on OpenBSD .... grrr 2014-06-02 16:31:37 +00:00
Roy Marples
153c1a11af Fix compile on FreeBSD 2014-06-02 15:00:24 +00:00
Roy Marples
3ed12ab824 Implement Stable Private Addresses for SLAAC as per RFC7217.
Add a SHA256 implementation by Collin Percival if one in libc/libmd not found.
2014-06-02 14:48:33 +00:00
Roy Marples
6d3ed56804 Fix configure error 2014-05-30 22:02:16 +00:00
Roy Marples
eb33667132 Add a compat syslog function if the libc syslog does not support LOG_PERROR.
Add a non working if-sun.c stub.
Define IN6_IFF_TENTATIVE and friends to zero so IPv6 at least compiles on Solaris.
Warn that Solaris support presently does not work.
2014-05-24 13:08:29 +00:00
Roy Marples
26c177737e Source now compiles on Solaris, just missing the if-sun.c support so
linking fails.
2014-05-21 23:07:52 +00:00
Roy Marples
bc8abcc65e Fix --disable-embedded [f097d9f0ef] 2014-04-25 08:16:02 +00:00
Roy Marples
dc3c8b9242 Move all Linux only sources into if-linux.c 2014-04-23 23:29:41 +00:00
Roy Marples
99ee99698f Move all BSD only sources into if-bsd.c 2014-04-23 20:09:20 +00:00
Roy Marples
1596f0102f Define a macro to include spawn.h or compat/spawn.h instead of forcing it in. 2014-04-23 09:43:30 +00:00
Roy Marples
4f6c549e86 Ship a compat queue.h for older systems without any TAILQ support. 2014-04-23 09:34:42 +00:00
Roy Marples
34457fe661 Add -Wconversion to debug CFLAGS and fix fallout. 2014-03-27 22:14:52 +00:00
Roy Marples
68dea6e3e6 Default to building static for a $PREFIX of \ for non Linux platforms
if ld.elf-so or similar cannot be found in /libexec.
2014-03-26 11:16:02 +00:00