scope6: Check for NULL afdata before dereferencing
Narrows the race window with if_detach. Approved by: mav (mentor) MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25017
This commit is contained in:
parent
cadd7992e2
commit
f057d56c6c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user