| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| |
|
|
|
| |
With this set dhcpcd will not configure anything on the host.
The expectation is that a 3rd party script will instead.
|
| |
|
|
|
|
|
| |
Move the IS_LINK_UP macro to if_is_link_up function to reduce
binary size.
Rather than DHCPCD_LINK option controlling the carrier state,
use it in if_is_link_up to determine the outcome.
|
| |
|
|
|
|
| |
Removes the need for the LINK_DOWN_IFFUP state.
While here, remove the check for IFF_RUNNING when LINK_UNKNOWN
because that is OS specific.
|
| |
|
|
|
|
|
|
| |
Otherwise the kernel WILL remove them.
dhcpcd already manages address removal when needed because
some OS's do not support address lifetimes even for IPv6.
While here apply the same logic to IPv6.
|
| | |
|
| |
|
|
|
| |
Per interface forwarding is apparently only for setting things
like IsRouter in NA messages.
|
| |
|
|
| |
Helps with interopability with OpenBSD's slaacd(8).
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
No longer needed now the main process forks from the get go.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Except for the priviledged process.
This is quite an in-depth change:
* ARP is now one process per address
* BPF flags are now returned via privsep
* BPF write filters are locked when supported
* The root process sends to the network
The last step is done by opening RAW sockets and then sending a UDP
header (where applicable) to avoid binding to an address
which is already in use by the reader sockets.
This is slightly wasteful for OS's without sandboxing but does
have the very nice side effect of not needing a source address
to unicast DHCPs replies from which makes the code smaller.
|
| |
|
|
|
|
|
|
|
|
| |
This allows us to move the database directory back into the
root of the filesystem.
While here, harden the files by denying any user read access to them.
As part of this change, init the DUID from any machine data and
cache the default DHCP vendor field before dropping priviledges as we
may lose access to this later.
|
| | |
|
| |
|
|
|
|
| |
It seems that FreeBSD doesn't allow binding to scoped addresses,
so let's use our functions everwhere rather than directly
setting scope.
|
| |
|
|
|
| |
This solves an infinite loop where new temp addrs regened are
added at the tail and we loop endlessly.
|
| |
|
|
|
|
| |
This is the final piece of DHCP6 to implement!
Part of this change drops the use of the IPV6_AF_DUPLICATED flag
and we just use IN6_IFF_DUPLICATED now.
|
| | |
|
| |
|
|
|
|
|
|
| |
This instructs dhcpcd to create a temporary address for each
address generated from a RA.
As such, dhcpcd no longer looks at the kernel option for it
as the functionality is being removed from some or never existed
in the first place.
|
| |
|
|
| |
As this is not possible.
|
| |
|
|
| |
This appears to just be cosmetic.
|
| | |
|
| |
|
|
|
|
|
|
| |
Vastly simpfly how they are generated and managed.
Temporary address generation now uses pure random numbers
rather than MD5ing over a random secret as arc4random should be
random enough. This change reflects RFC 4941bis.
|
| |
|
|
|
| |
With slaac private, it will generate a new address which would
be wrong.
|
| | |
|
| |
|
|
|
|
| |
This allows downstream implementions to inject their own data
into the log message and/or supply new logging targets whilst
preserving macros such as __FILE__ and __LINE__.
|
| |
|
|
|
| |
Now that we get inet6 routes even when only building inet routes
we need to guard as the RA routers collection could be NULL.
|
| |
|
|
| |
Rather than being clever and getting it wrong.
|
| |
|
|
| |
Also removed the TIMEOUT states which makes things easier to read.
|
| |
|
|
| |
Allows for easier maintainance.
|
| |
|
|
| |
This is apparently a thing. Unsure why, but heh ho.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This saves the need to store a created date per timer, we just need
to know when the timers were last changed which we can store in the
eloop.
This makes it easier to make the actual timeout for polling.
While here, add the eloop_timespec_diff function to workout the
elapsed time from usp to tsp even when time has wrapped on one or
both times.
This works if time wraps on the maximal size time_t allows AND
we know that tsp is always newer than usp.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On some systems time_t is int32_t.
However, on wire timeouts are generally uint32_t.
As such, we need to avoid using timespec internally except to
record when the timeout was created. Instead, record the timeout
as unsigned int seconds and long nanoseconds.
On long running systems using time_t as int32_t, monotonic time
would wrap after approximately 68 years. It's highly unlikely dhcpcd
would be running for so long, but just incase it does, the code
should now cope.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Split ipv6_addaddrs out so ipv6_doaddr can operate on a single address.
Call this when deprecating delegated addresses to avoid calling
ipv6_addaddrs.
This allows a more simple ipv6_addaddrs that doesn't need to test
which address collection we are deleting from and removes DHCPv6
specific code from the generic IPv6 module.
|
| |
|
|
|
| |
Be sure to remove the address using the right TAILQ member.
While here, simplify the initialisation of pd_pfxs.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not enabled by default - enable with ./configure --enable-privsep
Requires a user added to the system - default _dhcpcd
Several processes will be spawned off the main state engine:
a privileged actioneer and a generic network proxy.
Only the privileged actioneer process will retain root permissions.
When required, the privileged actioneer will also spawn
BPF listeners for BOOTP (DHCP) and ARP.
The BOOTP BPF listener should be a short lived process.
On kernels with RFC 5227 support, the ARP BPF listener will only
be used for ARPing and announcing a preferred address and will
also be a short lived process.
When not running in master mode, an address listener will be
spawned for each address (with the exception of RA dervived addresses)
dhcpcd cares about.
TODO:
* Solaris support.
* ARP BPF address filtering.
|
| |
|
|
|
| |
Interface maybe active but without options.
In this case, check the global state of IPv6.
|
| |
|
|
|
|
|
|
| |
We need to check for global addresses on any forwarding interface,
not just the interface we received the RA on.
Otherwise this breaks routers who get a default route only
from the RA and IPv6 addresses only by prefix delegation to
other interfaces.
|
| |
|
|
|
| |
This simplifies the code and allows onlink route "addresses"
to work on P2P interfaces.
|
| | |
|
| | |
|
| |
|
|
|
| |
These need to be added as subnet's and no address.
Kinda back to front, but heh ho.
|
| |
|
|
| |
We can use a lack of IFF_UP to set IN{,6}_IFF_TENTATIVE as well.
|
| | |
|
| | |
|