This is requires for newer Linux headers as there is no easy way to get at the
in6_pktinfo structure, so we have to fallback to the glibc variant which
requires _GNU_SOURCE being set.
This does have the advantage of no longer sprinkling _GNU_SOURCE around and
no longer having to cast ipi.ipi_ifindex but may break compile on older Linux.
lost. Also, it's output with LOG_PERROR is ugly and LOG_PERROR isn't portable.
logger is a new function to solve the above which is identical to syslog(3)
but takes a dhcpcd_ctx for context so it functions in the RTEMS OS.
When writing to stdout/stderr or a given logfile, logger will convert %m
into the error string based on errno, just like syslog(3) does.
If your libc supports %m via printf, then define HAVE_PRINTF_M to remove
a fair chunk of code. There is no way of working out if your libc supports
this, especially in cross-compiled environment.
If the logfile is rotated, send dhcpcd a SIGUSR2 and the logfile will be
re-opened.
This does add about an exta 4K on 64-bit platforms so for size constraints
this can be compiled out by defining USE_LOGFILE to 0.
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.
| ^ & ; < > ( ) $ ` \ " ' <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.
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.
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.
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.