device name, lun, ppa and driver name.
Use this function when discovering addresesses and when they arrive
via the kernel listening socket so they can be assigned to the correct
physical interface.
This change does also stop `dhcpcd eth0:1` working on Linux, but is needed
for basic Solaris support.
While here, stop making assumptions about the size of a DHCP packet based
on a fixed structure from a default MTU of 1500.
Instead, make it flexable and set the DHCP packet size to the interface MTU
less UDP and IP headers.
As a result, we need to know the size of the DHCP packet received
rather than just walking the old fixed DHCP message structure.
This makes Coverity happy about tainted scalar values when parsing DHCP
messages.
has that. So after opening the link socket, open a persistent route socket
and record the nlmsg_pid the kernel creates which is guaranteed unique
and won't clash with a process id which can then be ignored by testing it
directly and not that it's some large number.
instead.
pidfile_lock(3) should be found in NetBSD 8.
Provide a compat shim, from an earlier implementation I wrote still based
around flock if not available on host OS.
Then apply enough of the config for the base protocol, passed via an
argument, to work.
This means that when a prefix is delegated to an inactive interface, it
won't magically start configuring IPv4 on it.
flag that we are to track the parent pid.
On successful route message, remember the sequence number.
Once daemonised, ignore messages from the parent pid until we find
the saved sequence number - at this point remove the flag to track parent pid.
This fixes an issue where we didn't correctly ignore messages we generated
before forking but catching them in the child process.
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.