Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 182679) +++ sys/net/if.c (working copy) @@ -828,6 +828,9 @@ groupname[strlen(groupname) - 1] <= '9') return (EINVAL); + if (ifunit(groupname) != NULL) + return (EEXIST); + IFNET_WLOCK(); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) { @@ -1560,6 +1563,7 @@ char new_name[IFNAMSIZ]; struct ifaddr *ifa; struct sockaddr_dl *sdl; + struct ifg_group *ifg = NULL; ifr = (struct ifreq *)data; switch (cmd) { @@ -1671,6 +1675,14 @@ return (EINVAL); if (ifunit(new_name) != NULL) return (EEXIST); + + IFNET_RLOCK(); + TAILQ_FOREACH(ifg, &V_ifg_head, ifg_next) + if (!strcmp(ifg->ifg_group, groupname)) + IFNET_RUNLOCK(); + return (EEXIST); + } + IFNET_RUNLOCK(); /* Announce the departure of the interface. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE);