Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F104026658
D26300.id76552.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
835 B
Referenced Files
None
Subscribers
None
D26300.id76552.diff
View Options
Index: sys/kern/uipc_usrreq.c
===================================================================
--- sys/kern/uipc_usrreq.c
+++ sys/kern/uipc_usrreq.c
@@ -499,18 +499,14 @@
KASSERT(unp != NULL, ("uipc_accept: unp == NULL"));
*nam = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
- UNP_LINK_RLOCK();
- unp2 = unp->unp_conn;
- if (unp2 != NULL && unp2->unp_addr != NULL) {
- UNP_PCB_LOCK(unp2);
- sa = (struct sockaddr *) unp2->unp_addr;
- bcopy(sa, *nam, sa->sa_len);
- UNP_PCB_UNLOCK(unp2);
- } else {
+ UNP_PCB_LOCK(unp);
+ unp2 = unp_pcb_lock_peer(unp);
+ if (unp2 != NULL && unp2->unp_addr != NULL)
+ sa = (struct sockaddr *)unp2->unp_addr;
+ else
sa = &sun_noname;
- bcopy(sa, *nam, sa->sa_len);
- }
- UNP_LINK_RUNLOCK();
+ bcopy(sa, *nam, sa->sa_len);
+ unp_pcb_unlock_pair(unp, unp2);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 2:14 PM (21 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15008331
Default Alt Text
D26300.id76552.diff (835 B)
Attached To
Mode
D26300: [unix(4) cleanup 7/8] Fix locking in uipc_accept().
Attached
Detach File
Event Timeline
Log In to Comment