The global interface group list is also protected by the net lock and all
access to it (all within if.c) take it accordingly.
Getting all
- members of a group (SIOCGIFGMEMB),
- attributes of a group (SIOCGIFGATTR),
- groups (SIOCGIFGLIST)
are each read-only operations on the global interface group `ifg_head'.
The global interface list `ifnetlist' or its per-interface group lists are
not used in these ioctls.
OK mvs
-/* $OpenBSD: if.c,v 1.679 2022/11/14 22:07:30 kn Exp $ */
+/* $OpenBSD: if.c,v 1.680 2022/11/14 22:45:02 kn Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
error = if_clone_list((struct if_clonereq *)data);
return (error);
case SIOCGIFGMEMB:
- KERNEL_LOCK();
NET_LOCK_SHARED();
error = if_getgroupmembers(data);
NET_UNLOCK_SHARED();
- KERNEL_UNLOCK();
return (error);
case SIOCGIFGATTR:
- KERNEL_LOCK();
NET_LOCK_SHARED();
error = if_getgroupattribs(data);
NET_UNLOCK_SHARED();
- KERNEL_UNLOCK();
return (error);
case SIOCGIFGLIST:
- KERNEL_LOCK();
NET_LOCK_SHARED();
error = if_getgrouplist(data);
NET_UNLOCK_SHARED();
- KERNEL_UNLOCK();
return (error);
}