Neighbour Discovery information is protected by the net lock, as
documented in nd6.h struct nd_ifinfo.
ndp(8) is the only SIOCGIFINFO_IN6 and SIOCGNBRINFO_IN6 user in base.
nd6_lookup(), also used in ICMP6 input and IPv6 forwarding, only needs
the net lock.
OK mvs
-/* $OpenBSD: in6.c,v 1.256 2022/11/23 14:48:28 kn Exp $ */
+/* $OpenBSD: in6.c,v 1.257 2022/11/30 14:01:02 kn Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
break;
#endif /* MROUTING */
default:
- KERNEL_LOCK();
error = in6_ioctl(cmd, data, ifp, privileged);
- KERNEL_UNLOCK();
break;
}
return (error);
}
+ KERNEL_LOCK();
NET_LOCK();
if (sa6 != NULL) {
err:
NET_UNLOCK();
+ KERNEL_UNLOCK();
return (error);
}
return (error);
}
+ KERNEL_LOCK();
NET_LOCK_SHARED();
if (sa6 != NULL) {
err:
NET_UNLOCK_SHARED();
+ KERNEL_UNLOCK();
return (error);
}