diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-24 02:49:35 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-24 02:49:35 +0000 |
commit | 0a45582f4f03cb2c79111031d89f07c176d0ed8d (patch) | |
tree | 9ebad1d4e670daf1a1eafd9467be5f157831a634 /sys/net | |
parent | 922b03178875fd7a849597ae03b537f7822163ab (diff) |
actually delete the interface from the member list when it leaves the group
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 06b3f2fafdf..986d622be58 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.115 2005/05/24 02:45:17 reyk Exp $ */ +/* $OpenBSD: if.c,v 1.116 2005/05/24 02:49:34 henning Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1638,6 +1638,7 @@ int if_delgroup(struct ifnet *ifp, char *groupname) { struct ifg_list *ifgl; + struct ifg_member *ifgm; TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) @@ -1647,6 +1648,15 @@ if_delgroup(struct ifnet *ifp, char *groupname) TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); + TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) + if (ifgm->ifgm_ifp == ifp) + break; + + if (ifgm != NULL) { + TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifgm_next); + free(ifgm, M_TEMP); + } + if (--ifgl->ifgl_group->ifg_refcnt == 0) { TAILQ_REMOVE(&ifg_head, ifgl->ifgl_group, ifg_next); #if NPF > 0 |