OpenBSD: Ensure if_afreq is correct initialised.

This commit is contained in:
Roy Marples 2023-04-26 14:29:46 +01:00
parent 27c0b01164
commit 008121afd0

View File

@ -1763,10 +1763,9 @@ ip6_forwarding(__unused const char *ifname)
static int
if_af_attach(const struct interface *ifp, int af)
{
struct if_afreq ifar;
struct if_afreq ifar = { .ifar_af = af };
strlcpy(ifar.ifar_name, ifp->name, sizeof(ifar.ifar_name));
ifar.ifar_af = af;
return if_ioctl6(ifp->ctx, SIOCIFAFATTACH, &ifar, sizeof(ifar));
}
#endif