On Tue, Jul 05, 2016 at 03:44:17PM +0200, Simon Mages wrote: > Thats true, i found also another bug in this diff, the new one follows.
OK bluhm@ > Index: netinet/tcp_usrreq.c > =================================================================== > RCS file: /cvs/src/sys/netinet/tcp_usrreq.c,v > retrieving revision 1.131 > diff -u -p -u -p -r1.131 tcp_usrreq.c > --- netinet/tcp_usrreq.c 18 Jun 2016 10:36:13 -0000 1.131 > +++ netinet/tcp_usrreq.c 5 Jul 2016 13:41:49 -0000 > @@ -977,12 +977,13 @@ void > tcp_update_sndspace(struct tcpcb *tp) > { > struct socket *so = tp->t_inpcb->inp_socket; > - u_long nmax; > + u_long nmax = so->so_snd.sb_hiwat; > > - if (sbchecklowmem()) > + if (sbchecklowmem()) { > /* low on memory try to get rid of some */ > - nmax = tcp_sendspace; > - else if (so->so_snd.sb_wat != tcp_sendspace) > + if (tcp_sendspace < nmax) > + nmax = tcp_sendspace; > + } else if (so->so_snd.sb_wat != tcp_sendspace) > /* user requested buffer size, auto-scaling disabled */ > nmax = so->so_snd.sb_wat; > else > @@ -1017,10 +1018,11 @@ tcp_update_rcvspace(struct tcpcb *tp) > struct socket *so = tp->t_inpcb->inp_socket; > u_long nmax = so->so_rcv.sb_hiwat; > > - if (sbchecklowmem()) > + if (sbchecklowmem()) { > /* low on memory try to get rid of some */ > - nmax = tcp_recvspace; > - else if (so->so_rcv.sb_wat != tcp_recvspace) > + if (tcp_recvspace < nmax) > + nmax = tcp_recvspace; > + } else if (so->so_rcv.sb_wat != tcp_recvspace) > /* user requested buffer size, auto-scaling disabled */ > nmax = so->so_rcv.sb_wat; > else {