summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-20 12:23:25 +0100
committerRoy Marples <roy@marples.name>2020-05-20 12:23:25 +0100
commited42d4f666a2d6a03f8ae901dd864b8db39c635c (patch)
tree251d83467ac9df94ee2befeb8f4a91246a72b64e /src/ipv6.c
parentb060ddf2bc7e7f4d3302a1c708394d758b52c4b4 (diff)
downloaddhcpcd-ed42d4f666a2d6a03f8ae901dd864b8db39c635c.tar.xz
OpenBSD: Fix non privsep builds.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 9e3b62f6..025174bc 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1091,10 +1091,12 @@ ipv6_anyglobal(struct interface *sifp)
#ifdef BSD
bool forwarding;
-#ifdef HAVE_PLEDGE
- forwarding = ps_root_ip6forwarding(sifp->ctx) == 1;
+#if defined(PRIVSEP) && defined(HAVE_PLEDGE)
+ if (IN_PRIVSEP(sifp->ctx))
+ forwarding = ps_root_ip6forwarding(sifp->ctx) == 1;
+ else
#else
- forwarding = ip6_forwarding(NULL) == 1;
+ forwarding = ip6_forwarding(NULL) == 1;
#endif
#endif