Always socantsendmore() before deallocating a socket. This, in turn,
calls selwakeup() if necessary (which it is, if you don't want freed memory hanging around on your td->td_selq). Props to: alfred
This commit is contained in:
parent
c7a61a03e8
commit
f662a93197
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125724
@ -291,6 +291,7 @@ sofree(so)
|
||||
struct socket *so;
|
||||
{
|
||||
struct socket *head = so->so_head;
|
||||
int s;
|
||||
|
||||
KASSERT(so->so_count == 0, ("socket %p so_count not 0", so));
|
||||
|
||||
@ -314,6 +315,12 @@ sofree(so)
|
||||
so->so_state &= ~SS_INCOMP;
|
||||
so->so_head = NULL;
|
||||
}
|
||||
so->so_snd.sb_flags |= SB_NOINTR;
|
||||
(void)sblock(&so->so_snd, M_WAITOK);
|
||||
s = splimp();
|
||||
socantsendmore(so);
|
||||
splx(s);
|
||||
sbunlock(&so->so_snd);
|
||||
sbrelease(&so->so_snd, so);
|
||||
sorflush(so);
|
||||
sodealloc(so);
|
||||
|
Loading…
Reference in New Issue
Block a user