in_pcbnotifyall() requires an exclusive protocol lock for notify functions

which modify the connection list, namely, tcp_notify().
This commit is contained in:
Jeffrey Hsu 2003-02-12 23:55:07 +00:00
parent 9cb460b85a
commit 3dc7ebf9ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110775

View File

@ -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);
}