See "Document global interface group list locking" on tech@ --- 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. Feedback? OK? --- sys/net/if.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 5dd40f97518..6b13c2800fb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2390,25 +2390,19 @@ ifioctl_get(u_long cmd, caddr_t data) 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); } -- 2.38.1