summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-02-04 15:44:49 +0000
committerRoy Marples <roy@marples.name>2020-02-04 15:44:49 +0000
commita4afbd4c6eadb84bc31e21c8cfdcab56bc5df2ab (patch)
tree45e7c2d7c809228692354b8ae0523c28905a7c34 /src/if-bsd.c
parent17082b2bd56f50171a20150c47ce884eda39fa13 (diff)
downloaddhcpcd-a4afbd4c6eadb84bc31e21c8cfdcab56bc5df2ab.tar.xz
BSD: When applying RA base information, get info without privsep
privsep cannot current pass it back ..... duh
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index b14650ce..99211958 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1589,19 +1589,20 @@ int
if_applyra(const struct ra *rap)
{
#ifdef SIOCSIFINFO_IN6
- struct in6_ndireq ndi = { .ndi.chlim = 0 };
+ struct in6_ndireq nd = { .ndi.chlim = 0 };
struct dhcpcd_ctx *ctx = rap->iface->ctx;
+ struct priv *priv = ctx->priv;
int error;
- strlcpy(ndi.ifname, rap->iface->name, sizeof(ndi.ifname));
- if (if_ioctl6(ctx, SIOCGIFINFO_IN6, &ndi, sizeof(ndi)) == -1)
+ strlcpy(nd.ifname, rap->iface->name, sizeof(nd.ifname));
+ if (ioctl(priv->pf_inet6_fd, SIOCGIFINFO_IN6, &nd, sizeof(nd)) == -1)
return -1;
- ndi.ndi.linkmtu = rap->mtu;
- ndi.ndi.chlim = rap->hoplimit;
- ndi.ndi.retrans = rap->retrans;
- ndi.ndi.basereachable = rap->reachable;
- error = if_ioctl6(ctx, SIOCSIFINFO_IN6, &ndi, sizeof(ndi));
+ nd.ndi.linkmtu = rap->mtu;
+ nd.ndi.chlim = rap->hoplimit;
+ nd.ndi.retrans = rap->retrans;
+ nd.ndi.basereachable = rap->reachable;
+ error = if_ioctl6(ctx, SIOCSIFINFO_IN6, &nd, sizeof(nd));
if (error == -1 && errno == EINVAL) {
/*
* Very likely that this is caused by a dodgy MTU
@@ -1610,8 +1611,8 @@ if_applyra(const struct ra *rap)
* Doesn't really matter as we fix the MTU against the
* routes we add as not all OS support SIOCSIFINFO_IN6.
*/
- ndi.ndi.linkmtu = 0;
- error = if_ioctl6(ctx, SIOCSIFINFO_IN6, &ndi, sizeof(ndi));
+ nd.ndi.linkmtu = 0;
+ error = if_ioctl6(ctx, SIOCSIFINFO_IN6, &nd, sizeof(nd));
}
return error;
#else