Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150123004
D20936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1015 B
Referenced Files
None
Subscribers
None
D20936.diff
View Options
Index: head/sys/netinet6/udp6_usrreq.c
===================================================================
--- head/sys/netinet6/udp6_usrreq.c
+++ head/sys/netinet6/udp6_usrreq.c
@@ -742,9 +742,24 @@
* - when we are not bound to an address and source port (it is
* in6_pcbsetport() which will require the write lock).
*/
+retry:
if (sin6 == NULL || (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) &&
inp->inp_lport == 0)) {
INP_WLOCK(inp);
+ /*
+ * In case we lost a race and another thread bound addr/port
+ * on the inp we cannot keep the wlock (which still would be
+ * fine) as further down, based on these values we make
+ * decisions for the pcbinfo lock. If the locks are not in
+ * synch the assertions on unlock will fire, hence we go for
+ * one retry loop.
+ */
+ if (sin6 != NULL &&
+ (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) ||
+ inp->inp_lport != 0)) {
+ INP_WUNLOCK(inp);
+ goto retry;
+ }
unlock_inp = UH_WLOCKED;
} else {
INP_RLOCK(inp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 2:06 PM (7 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30588989
Default Alt Text
D20936.diff (1015 B)
Attached To
Mode
D20936: Fix a race in udp6_output
Attached
Detach File
Event Timeline
Log In to Comment