View | Details | Raw Unified | Return to bug 127042
Collapse All | Expand All

(-)sys/net/if.c (+12 lines)
Lines 828-833 Link Here
828
	    groupname[strlen(groupname) - 1] <= '9')
828
	    groupname[strlen(groupname) - 1] <= '9')
829
		return (EINVAL);
829
		return (EINVAL);
830
830
831
	if (ifunit(groupname) != NULL)
832
		return (EEXIST);
833
831
	IFNET_WLOCK();
834
	IFNET_WLOCK();
832
	TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next)
835
	TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next)
833
		if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) {
836
		if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) {
Lines 1560-1565 Link Here
1560
	char new_name[IFNAMSIZ];
1563
	char new_name[IFNAMSIZ];
1561
	struct ifaddr *ifa;
1564
	struct ifaddr *ifa;
1562
	struct sockaddr_dl *sdl;
1565
	struct sockaddr_dl *sdl;
1566
	struct ifg_group *ifg = NULL;
1563
1567
1564
	ifr = (struct ifreq *)data;
1568
	ifr = (struct ifreq *)data;
1565
	switch (cmd) {
1569
	switch (cmd) {
Lines 1671-1676 Link Here
1671
			return (EINVAL);
1675
			return (EINVAL);
1672
		if (ifunit(new_name) != NULL)
1676
		if (ifunit(new_name) != NULL)
1673
			return (EEXIST);
1677
			return (EEXIST);
1678
1679
		IFNET_RLOCK();
1680
		TAILQ_FOREACH(ifg, &V_ifg_head, ifg_next)
1681
			if (!strcmp(ifg->ifg_group, groupname))
1682
				IFNET_RUNLOCK();
1683
				return (EEXIST);
1684
			}
1685
		IFNET_RUNLOCK();
1674
		
1686
		
1675
		/* Announce the departure of the interface. */
1687
		/* Announce the departure of the interface. */
1676
		rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
1688
		rt_ifannouncemsg(ifp, IFAN_DEPARTURE);

Return to bug 127042