Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153801589
D17647.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
808 B
Referenced Files
None
Subscribers
None
D17647.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
Fri, Apr 24, 8:58 PM (2 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32091392
Default Alt Text
D17647.diff (808 B)
Attached To
Mode
D17647: Resolve deadlock between epoch(9) and various network interface SX-locks
Attached
Detach File
Event Timeline
Log In to Comment