summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-03-14 10:40:22 +0000
committerRoy Marples <roy@marples.name>2020-03-14 10:40:22 +0000
commit0035fb391f55ba9b124d2554d3ab4018f8fdfad8 (patch)
tree6ef04a81591e5c00922f87dfa19016df18578c25 /src/if-bsd.c
parentd803cae7e15742a09e7da8a9a6a0baca048732d4 (diff)
downloaddhcpcd-0035fb391f55ba9b124d2554d3ab4018f8fdfad8.tar.xz
BSD: use satosin6 rather than a direct cast
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index 00569874..0103d845 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1522,11 +1522,8 @@ if_missfilter0(struct dhcpcd_ctx *ctx, struct interface *ifp,
}
#ifdef INET6
- if (sa->sa_family == AF_INET6) {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
- ifa_setscope(sin6, ifp->index);
- }
+ if (sa->sa_family == AF_INET6)
+ ifa_setscope(satosin6(sa), ifp->index);
#endif
cp = ctx->rt_missfilter + ctx->rt_missfilterlen;
@@ -1536,11 +1533,8 @@ if_missfilter0(struct dhcpcd_ctx *ctx, struct interface *ifp,
ctx->rt_missfilterlen += salen;
#ifdef INET6
- if (sa->sa_family == AF_INET6) {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
- ifa_setscope(sin6, 0);
- }
+ if (sa->sa_family == AF_INET6)
+ ifa_setscope(satosin6(sa), 0);
#endif
return 0;