Date: Wed, 3 Apr 2013 15:30:01 GMT From: Gleb Smirnoff <glebius@FreeBSD.org> To: freebsd-net@FreeBSD.org Subject: Re: misc/177456: An error of calculating TCP sequence number will resault in the machine to restart Message-ID: <201304031530.r33FU1AY097998@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/177456; it has been noted by GNATS. From: Gleb Smirnoff <glebius@FreeBSD.org> To: ?????? <lglion718@163.com> Cc: bug-followup@FreeBSD.org Subject: Re: misc/177456: An error of calculating TCP sequence number will resault in the machine to restart Date: Wed, 3 Apr 2013 19:21:12 +0400 Hi! On Wed, Apr 03, 2013 at 07:52:42AM +0800, ?????? wrote: ?> I mean there is a bug in FreeBSD's tcp code. I'm trying to describe it by pictuer. Pelease see the attachments?? I am trying to model what you are describing in the picture by special crafted code. I intentionally model memory allocation failure on first two packets for a connection that has special socket option. I'm modelling allocation failure at tcp_output.c near line 900: Index: tcp_output.c =================================================================== --- tcp_output.c (revision 249051) +++ tcp_output.c (working copy) @@ -898,6 +898,13 @@ send: else TCPSTAT_INC(tcps_sndwinup); + /* Fail allocating first 2 packets. */ + if (tp->t_flags & TF_ZHOPA && tp->t_zhopa < 2) { + tp->t_zhopa++; + m = NULL; + error = ENOBUFS; + goto out; + } else m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; I have no success in reproducing your problems. With above code, first 2 packets are failing to allocate, but third retransmission succeeds and connection is established with no problems. May be I incorrectly understand your description :( Please don't give up and try to explain again. A modelling code that demonstrates problem would be appreciated. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304031530.r33FU1AY097998>