summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-24 05:47:14 +0000
committerRoy Marples <roy@marples.name>2020-05-24 05:47:14 +0000
commit12b0db43b2a139744fbcf04824390fcb1de445ea (patch)
tree5cde5e68c8d6710d707d8a54da0de97d856b7602 /src/ipv6nd.c
parentc572835e98da5a186f7453f3daa2aec765ef2d9b (diff)
downloaddhcpcd-12b0db43b2a139744fbcf04824390fcb1de445ea.tar.xz
privsep: Allow Linux to work without needing any mounts
Diffstat (limited to 'src/ipv6nd.c')
-rw-r--r--src/ipv6nd.c10
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;