diff options
| author | Roy Marples <roy@marples.name> | 2020-05-24 05:47:14 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-05-24 05:47:14 +0000 |
| commit | 12b0db43b2a139744fbcf04824390fcb1de445ea (patch) | |
| tree | 5cde5e68c8d6710d707d8a54da0de97d856b7602 /src/ipv6nd.c | |
| parent | c572835e98da5a186f7453f3daa2aec765ef2d9b (diff) | |
| download | dhcpcd-12b0db43b2a139744fbcf04824390fcb1de445ea.tar.xz | |
privsep: Allow Linux to work without needing any mounts
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 924dc9de..e56fd413 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -524,11 +524,13 @@ ipv6nd_advertise(struct ipv6_addr *ia) na->nd_na_type = ND_NEIGHBOR_ADVERT; na->nd_na_flags_reserved = ND_NA_FLAG_OVERRIDE; -#ifdef HAVE_PLEDGE - if (ps_root_ip6_forwarding(ctx) == 1) -#else - if (ip6_forwarding(ifp->name) == 1) +#if defined(PRIVSEP) && (defined(__linux__) || defined(HAVE_PLEDGE)) + if (IN_PRIVSEP(ctx)) { + if (ps_root_ip6forwarding(ctx, ifp->name) == 1) + na->nd_na_flags_reserved |= ND_NA_FLAG_ROUTER; + } else #endif + if (ip6_forwarding(ifp->name) == 1) na->nd_na_flags_reserved |= ND_NA_FLAG_ROUTER; na->nd_na_target = ia->addr; |
