[net.bugs.4bsd] tcp/ip protocol implementation bug

jeff@idacrd.UUCP (Abundant Nose) (02/13/86)

The tcp/ip implementation in 4.2BSD has a bug when tcp header options are
included in packets containing data.  The effect of this bug is that 
data bytes are lost.  The number of bytes lost is equal to the length of
the tcp options transmitted.  This problem was encountered in implementing
tcp/ip on the CRAY-1 since it is advantageous to pad tcp/ip headers with
the no-op function to align the data on CRAY word boundaries.  Whenever
a data message was sent, say to a vax, some bytes from the beginning of the data
were lost.  The culprit is tcp_input.c.  To fix the problem, add the statement:

		off = sizeof(struct tcphdr);

in the section of the code that copies the tcp header options into the 
mbuf pointed to by om.  The problem is that variable off is not decremented
by the length of the tcp options and causes more bytes than just the length
of the tcp/ip header to be deleted from the mbuf chain.  Any questions can
be addressed to me (Jeff Huskamp).