buglwIP - A Lightweight TCP/IP stack - Bugs: bug #35945, SYN packet should provide the recv...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #35945: SYN packet should provide the recv MSS not the send MSS

Submitted by:  Mason <mason>
Submitted on:  Thu 22 Mar 2012 12:32:35 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.4.0

Wed 28 Mar 2012 09:10:52 AM UTC, comment #5:

> That's what I said in the original submission ;-)


Hehe, seems like I didn't notice that...

> Your fix has a small problem [..]


Thanks for checking that, I didn't notice that indeed. -> fixed in both branches.

> The other small problem is that we're dealing with the RECEIVE MSS [..]


Yeah, actually I hadn't cared about that fact too much since I though "effective send mss" is a somewhat fixed term in TCP.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Wed 28 Mar 2012 08:12:11 AM UTC, comment #4:

Simon Goldschmidt wrote:

> Finally found the time. This bug has been introduced after 1.4.0,
> when fixing bug #34587.


That's what I said in the original submission ;-)

> Fixed for both 1.4.1 and master branches. Thanks for reporting and insisting
> on this, you saved me from introducing a new bug to 1.4.1 :-)


Your fix has a small problem (that I tried to avoid in mine).
If a port has set TCP_CALCULATE_EFF_SEND_MSS to 0, then
tcp_eff_send_mss is undefined and undeclared.

I think you need to guard the use of tcp_eff_send_mss
with the TCP_CALCULATE_EFF_SEND_MSS macro.

The other small problem is that we're dealing with the RECEIVE MSS,
so the name of the function is misleading. That's why I suggested
renaming it. Perhaps the renaming can be done in the 1.5 branch?

Mason <mason>
Tue 27 Mar 2012 06:23:16 PM UTC, comment #3:

Finally found the time. This bug has been introduced after 1.4.0, when fixing bug #34587.

Fixed for both 1.4.1 and master branches. Thanks for reporting and insisting on this, you saved me from introducing a new bug to 1.4.1 :-)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 23 Mar 2012 09:15:25 AM UTC, comment #2:

Simon,

Can this bug be fixed in time for 1.4.1?

Do you need more information?

Mason <mason>
Thu 22 Mar 2012 01:03:50 PM UTC, comment #1:

More realistic patch:

What remains is the (now) inappropriate function name.
Perhaps tcp_eff_send_mss should be renamed to tcp_eff_mss
and TCP_CALCULATE_EFF_SEND_MSS to TCP_CALCULATE_EFF_MSS?

Comments?

Mason <mason>
Thu 22 Mar 2012 12:32:35 PM UTC, original submission:

The fix for bug #34587 is incorrect.

As noted in RFC 879:

Currently, lwip confuses the recv MSS with the send MSS
(pcb->mss is the send MSS; I don't think we keep track of
the recv MSS right now, since it's only needed for the SYN)

Basically,
recv_MSS = MIN(TCP_MSS, MTU(link) - 40)
send_MSS = MIN(576, MTU(link)) - 40

send_MSS must be more conservative than recv_MSS, as we must assume that
the distant host cannot process datagrams larger than 576 in IPv4.
(NB: the value is 1280 in IPv6).

The problem is that I don't see an easy way in tcp_output_segment
to get the MTU of the output link...

Proposed patch to illustrate my comment:

Comments? Thoughts?

cf. also this discussion

Mason <mason>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by mason (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Mar 2012 06:23:16 PM UTCgoldsimonAssigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
      Planned Release=>1.4.1
    Tue 27 Mar 2012 06:23:15 PM UTCgoldsimonStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1