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.
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.
Only one call to write(2) should be performed for each POLLOUT check
via poll(2) so we should never see EAGAIN when writing to control
sockets ever again.
Each fd queue is limited to 100 entries so we don't OOM with badly
written control subscribers.
Add ipv4, ipv6, dhcp and dhcp6 options to re-enable if disabled globally.
Try and load a delegated interface if not running on all interfaces.
Fix delegated interfaces without a prefix set.
replacing an existing IPv4 address with the same values.
As such, we need to maintain a list of configured IPv4 addresses
for each interface so we know when to add it and when to skip it
to avoid receiving bogus RTM_DELADDR messages from ourself.
Only NetBSD emits RTM_CHGADDR for link address changes.
Sadly no other BSD emits anything for link address changes so we have
to do a full discovery on carrier up.
When a link address does change, simply carry on as we are, no need
to drop any existing lease as the carrier change will do that for us.
Log the PID of the signal caller
Move syslog functions out of the signal handler if we're not
exiting as it's not safe.
Close existing IPv4 sockets when restarting an interface.
Fix control handling keeping current flags and accepting new ones.
Listen to kernel messages to account them.
If we don't have a local link address, delay IPv6RS as it just
won#t work until we have a local link address.