diff options
| author | Roy Marples <roy@marples.name> | 2019-11-28 16:41:15 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2019-11-28 16:41:15 +0000 |
| commit | d5786118da1bad4c247631cae86344f1b249a8cb (patch) | |
| tree | b62b1e3a7ba544c9e842e6f595b25fdaab8059b4 /src/ipv6.c | |
| parent | f90486b1657f0331ae5e7d817b9ba3de90856d52 (diff) | |
| download | dhcpcd-d5786118da1bad4c247631cae86344f1b249a8cb.tar.xz | |
privsep: Add support for priviledge separation
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.
Diffstat (limited to 'src/ipv6.c')
| -rw-r--r-- | src/ipv6.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -581,7 +581,10 @@ static void ipv6_deletedaddr(struct ipv6_addr *ia) { -#ifdef SMALL +#ifdef PRIVSEP + if (!(ia->iface->ctx->options & DHCPCD_MASTER)) + ps_inet_closedhcp6(ia); +#elif defined(SMALL) UNUSED(ia); #else /* NOREJECT is set if we delegated exactly the prefix to another @@ -1803,9 +1806,9 @@ ipv6_handleifa_addrs(int cmd, ia->iface->name, pid, ia->saddr); ia->flags &= ~IPV6_AF_ADDED; } + ipv6_deletedaddr(ia); if (ia->flags & IPV6_AF_DELEGATED) { TAILQ_REMOVE(addrs, ia, next); - ipv6_deletedaddr(ia); ipv6_freeaddr(ia); } break; |
