First the right address is picked from the net lock protected if_addrlist.
Then all ioctls just copy out the address, nothing requires the kernel lock.
SIOCGIFDSTADDR_IN6 checks the net lock protected if_flags,
SIOCGIFALIFETIME_IN6 computes lifetimes which only need the address.
This removes the last kernel lock from IPv6 read ioctls (multicast being
the untouched exception here).
Users of these ioctl(2)s are route6d(8), rad(8), slaacd(8), isakmpd(8) and
of course ifconfig(8).
OK mvs
-/* $OpenBSD: in6.c,v 1.257 2022/11/30 14:01:02 kn Exp $ */
+/* $OpenBSD: in6.c,v 1.258 2022/12/02 12:56:51 kn Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
return (error);
}
- KERNEL_LOCK();
NET_LOCK_SHARED();
if (sa6 != NULL) {
err:
NET_UNLOCK_SHARED();
- KERNEL_UNLOCK();
return (error);
}