summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/if.c b/src/if.c
index 3fbb38f7..e479dc35 100644
--- a/src/if.c
+++ b/src/if.c
@@ -617,7 +617,7 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
/* Respect the interface priority */
memset(&ifr, 0, sizeof(ifr));
strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
- if (ioctl(ctx->pf_inet_fd, SIOCGIFPRIORITY, &ifr) == 0)
+ if (pioctl(ctx, SIOCGIFPRIORITY, &ifr, sizeof(ifr)) == 0)
ifp->metric = (unsigned int)ifr.ifr_metric;
if_getssid(ifp);
#else
@@ -771,7 +771,8 @@ if_domtu(const struct interface *ifp, short int mtu)
if (mtu != 0)
r = if_ioctl(ifp->ctx, SIOCSIFMTU, &ifr, sizeof(ifr));
else
- r = ioctl(ifp->ctx->pf_inet_fd, SIOCGIFMTU, &ifr);
+ r = pioctl(ifp->ctx, SIOCGIFMTU, &ifr, sizeof(ifr));
+
if (r == -1)
return -1;
return ifr.ifr_mtu;