Subject: Re: TCP MSS not adhered to properly when options present
To: None <tech-net@netbsd.org>
From: Scott Barron <sb125499@oak.cats.ohiou.edu>
List: tech-net
Date: 11/30/2001 10:23:39
Hmmm, right after I post this I notice in tcp_segsize() that size is being
decreased by tcp_optlen() (which returns TCPOLEN_TSTAMP_APPA if the
timestamp options are set) and then uses the min of that size and the
peer mss. So it looks like it should be doing the right thing. Sorry
to reply to my own post, I will ensure that I am properly caffienated
before future posts.
-Scott
>
> Alright I broke out TCP/IP Illustrated v2 and noticed the following
> snippet of code that is missing from the NetBSD code:
>
> /*
> * Adjust data length if insertion of options will
> * bump the packet length beyond the t_maxseg length.
> */
> if (len > tp->t_maxseg - optlen) {
> len = tp->t_maxseg - optlen;
> sendalot = 1;
> }
>
> This seems to do what you're talking about but I'm not sure why it was
> removed (haven't been around that long). Would this do the trick?
> (Against a -current checked out very early this morning (Nov 30)). This
> built but I haven't tested it.
>
> Index: tcp_output.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/netinet/tcp_output.c,v
> retrieving revision 1.75
> diff -r1.75 tcp_output.c
> 745a746,750
> >
> > if (len > txsegsize - optlen) {
> > len = txsegsize - optlen;
> > sendalot = 1;
> > }
>
> -Scott