Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177566059
D17647.1794751575.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
808 B
Referenced Files
None
Subscribers
None
D17647.1794751575.diff
View Options
Index: head/sys/net/if.c
===================================================================
--- head/sys/net/if.c
+++ head/sys/net/if.c
@@ -964,12 +964,18 @@
void
if_purgeaddrs(struct ifnet *ifp)
{
- struct ifaddr *ifa, *next;
+ struct ifaddr *ifa;
- NET_EPOCH_ENTER();
- CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
- if (ifa->ifa_addr->sa_family == AF_LINK)
- continue;
+ while (1) {
+ NET_EPOCH_ENTER();
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ if (ifa->ifa_addr->sa_family != AF_LINK)
+ break;
+ }
+ NET_EPOCH_EXIT();
+
+ if (ifa == NULL)
+ break;
#ifdef INET
/* XXX: Ugly!! ad hoc just for INET */
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -996,7 +1002,6 @@
IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
}
- NET_EPOCH_EXIT();
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 2:06 PM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41743750
Default Alt Text
D17647.1794751575.diff (808 B)
Attached To
Mode
D17647: Resolve deadlock between epoch(9) and various network interface SX-locks
Attached
Detach File
Event Timeline