diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2010-05-21 16:07:20 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2010-05-21 16:07:20 +0000 |
| commit | af73bcd78771a5e9d00cb70793b522a231820985 (patch) | |
| tree | ae22e7df42b7563f9028f2497676c30bb24c33e9 /sys/net | |
| parent | dd0cfed81001600f705240173c14ce34e201be68 (diff) | |
Notes
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if_vlan.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index c513bd719f96..3bce028e23ef 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -186,8 +186,8 @@ static int vlan_setflag(struct ifnet *ifp, int flag, int status, int (*func)(struct ifnet *, int)); static int vlan_setflags(struct ifnet *ifp, int status); static int vlan_setmulti(struct ifnet *ifp); -static int vlan_unconfig(struct ifnet *ifp); -static int vlan_unconfig_locked(struct ifnet *ifp); +static void vlan_unconfig(struct ifnet *ifp); +static void vlan_unconfig_locked(struct ifnet *ifp); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); static void vlan_link_state(struct ifnet *ifp, int link); static void vlan_capabilities(struct ifvlan *ifv); @@ -1081,25 +1081,22 @@ done: return (error); } -static int +static void vlan_unconfig(struct ifnet *ifp) { - int ret; VLAN_LOCK(); - ret = vlan_unconfig_locked(ifp); + vlan_unconfig_locked(ifp); VLAN_UNLOCK(); - return (ret); } -static int +static void vlan_unconfig_locked(struct ifnet *ifp) { struct ifvlantrunk *trunk; struct vlan_mc_entry *mc; struct ifvlan *ifv; struct ifnet *parent; - int error; VLAN_LOCK_ASSERT(); @@ -1128,9 +1125,15 @@ vlan_unconfig_locked(struct ifnet *ifp) while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) { bcopy((char *)&mc->mc_addr, LLADDR(&sdl), ETHER_ADDR_LEN); - error = if_delmulti(parent, (struct sockaddr *)&sdl); - if (error) - return (error); + + /* + * This may fail if the parent interface is + * being detached. Regardless, we should do a + * best effort to free this interface as much + * as possible as all callers expect vlan + * destruction to succeed. + */ + (void)if_delmulti(parent, (struct sockaddr *)&sdl); SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); free(mc, M_VLAN); } @@ -1176,8 +1179,6 @@ vlan_unconfig_locked(struct ifnet *ifp) */ if (parent != NULL) EVENTHANDLER_INVOKE(vlan_unconfig, parent, ifv->ifv_tag); - - return (0); } /* Handle a reference counted flag that should be set on the parent as well */ |
