From: Roy Marples Date: Sat, 14 Mar 2020 10:40:22 +0000 (+0000) Subject: BSD: use satosin6 rather than a direct cast X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0035fb391f55ba9b124d2554d3ab4018f8fdfad8;p=thirdparty%2Fdhcpcd.git BSD: use satosin6 rather than a direct cast --- 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;