mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 15:40:44 +00:00
in_pcbnotifyall() requires an exclusive protocol lock for notify functions
which modify the connection list, namely, tcp_notify().
This commit is contained in:
parent
9cb460b85a
commit
3dc7ebf9ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110775
|
@ -752,26 +752,26 @@ in_pcbnotifyall(pcbinfo, faddr, errno, notify)
|
|||
int s;
|
||||
|
||||
s = splnet();
|
||||
INP_INFO_RLOCK(pcbinfo);
|
||||
INP_INFO_WLOCK(pcbinfo);
|
||||
head = pcbinfo->listhead;
|
||||
for (inp = LIST_FIRST(head); inp != NULL; inp = ninp) {
|
||||
INP_LOCK(inp);
|
||||
ninp = LIST_NEXT(inp, inp_list);
|
||||
#ifdef INET6
|
||||
if ((inp->inp_vflag & INP_IPV4) == 0) {
|
||||
INP_UNLOCK(inp);
|
||||
INP_UNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (inp->inp_faddr.s_addr != faddr.s_addr ||
|
||||
inp->inp_socket == NULL) {
|
||||
INP_UNLOCK(inp);
|
||||
continue;
|
||||
INP_UNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
(*notify)(inp, errno);
|
||||
INP_UNLOCK(inp);
|
||||
if ((*notify)(inp, errno))
|
||||
INP_UNLOCK(inp);
|
||||
}
|
||||
INP_INFO_RUNLOCK(pcbinfo);
|
||||
INP_INFO_WUNLOCK(pcbinfo);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue