diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c index 0653d537eec1..0489651d877b 100644 --- a/sys/netinet6/scope6.c +++ b/sys/netinet6/scope6.c @@ -422,6 +422,10 @@ in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id) struct epoch_tracker et; NET_EPOCH_ENTER(et); + if (ifp->if_afinfo[AF_INET6] == NULL) { + NET_EPOCH_EXIT(et); + return (ENETDOWN); + } sid = SID(ifp); zoneid = sid->s6id_list[scope]; NET_EPOCH_EXIT(et);