aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-08-24 04:45:02 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-08-24 04:45:02 +0000
commit2b1489c08651d3b67785e23462d46a29fb4a1123 (patch)
tree7aba5c30d21b1fb20b6931e6d81402faf57f5df0 /sys/net
parentb65ff148a9c85a28c86c70a5b1b4cc561ef8897e (diff)
Notes
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index d129439490a9..038e9f22e76f 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -368,6 +368,7 @@ if_alloc(u_char type)
return (NULL);
}
}
+ IF_ADDR_LOCK_INIT(ifp);
return (ifp);
}
@@ -378,8 +379,6 @@ if_free(struct ifnet *ifp)
/* Do not add code to this function! Add it to if_free_type(). */
if_free_type(ifp, ifp->if_type);
-
- IF_ADDR_LOCK_DESTROY(ifp);
}
void
@@ -392,6 +391,8 @@ if_free_type(struct ifnet *ifp, u_char type)
return;
}
+ IF_ADDR_LOCK_DESTROY(ifp);
+
ifnet_byindex(ifp->if_index) = NULL;
/* XXX: should be locked with if_findindex() */
@@ -423,7 +424,6 @@ if_attach(struct ifnet *ifp)
TASK_INIT(&ifp->if_starttask, 0, if_start_deferred, ifp);
TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp);
IF_AFDATA_LOCK_INIT(ifp);
- IF_ADDR_LOCK_INIT(ifp);
ifp->if_afdata_initialized = 0;
IFNET_WLOCK();
TAILQ_INSERT_TAIL(&ifnet, ifp, if_link);