Check the inp_flags under inp lock. Looks like the race was hidden

before, the conversion of tcbinfo to CK_LIST have uncovered it.
This commit is contained in:
Gleb Smirnoff 2018-06-27 22:01:59 +00:00
parent 95dce07dea
commit b8ab659396
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335749

View File

@ -2019,9 +2019,11 @@ tcp_drain(void)
*/
INP_INFO_WLOCK(&V_tcbinfo);
CK_LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) {
if (inpb->inp_flags & INP_TIMEWAIT)
continue;
INP_WLOCK(inpb);
if (inpb->inp_flags & INP_TIMEWAIT) {
INP_WUNLOCK(inpb);
continue;
}
if ((tcpb = intotcpcb(inpb)) != NULL) {
tcp_reass_flush(tcpb);
tcp_clean_sackreport(tcpb);