Fix a bug that WILL cause a panic. Basically

a read-lock is being called to check the vtag-timewait cache.
Then in two cases (where a vtag is bad i.e. in the time-wait
state) the write-unlock is called NOT the read-unlock. Under
conditions where lots of associations are coming and going
this will cause the system to panic at some point.

MFC after:	3 days
This commit is contained in:
Randall Stewart 2010-07-02 09:53:26 +00:00
parent 8d7c49114c
commit 606c58db25

View file

@ -6499,7 +6499,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp, uint32_t tag, uint16_t lport, uint16_t
continue;
}
/* Its a used tag set */
SCTP_INP_INFO_WUNLOCK();
SCTP_INP_INFO_RUNLOCK();
return (0);
}
}
@ -6528,7 +6528,7 @@ skip_vtag_check:
(twait_block->vtag_block[i].lport == lport) &&
(twait_block->vtag_block[i].rport == rport)) {
/* Bad tag, sorry :< */
SCTP_INP_INFO_WUNLOCK();
SCTP_INP_INFO_RUNLOCK();
return (0);
}
}