buglwIP - A Lightweight TCP/IP stack - Bugs: bug #32418, tcp_seg->dataptr: does it point...

 
 

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

bug #32418: tcp_seg->dataptr: does it point to tcp-data or -options?

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Thu 10 Feb 2011 08:17:36 PM UTC  
 
Category: TCPSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Sun 27 Mar 2011 01:02:01 PM UTC, comment #3:

Fixed like suggested in my last post by removing 'dataptr' from 'struct tcp_seg' and calculating it in tcp_zero_window_probe (the only place where it was used).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 14 Mar 2011 09:36:27 PM UTC, comment #2:

I expect the "Fix dataptr for the nocopy case" was just a fix for the dataptr not pointing behind the end of the pbuf allocated for the header only.

And yes, it seems like this has slipped in with the TCP_OVERSIZE change. seg->dataptr always has pointed to the beginning of the TCP data and should continue to do so since it is used for zero-window-probes (and we should send data there, not options).

Speaking of it, we could remove 'dataptr' altogether to save RAM if we changed the zero-window-probe implementation (currently the only point where 'dataptr' is read - not written...).

I would fix this in tcp_create_segment(), since the optlen is known there.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 11 Feb 2011 09:27:31 AM UTC, comment #1:

I'm not sure if this is causing any problems, but I think this it is potentially serious enough to be looked at before 1.4.0

Kieran Mansley <kieranm>
Project Administrator
Thu 10 Feb 2011 08:17:36 PM UTC, original submission:

There seems to be a discrepancy (introduced by the tcp_create_segment() function introduced with TCP_OVERSIZE?):

on 02.09.2011, MK wrote on lwip-devel:

For tcp_seg, is the dataptr in it pointing to the beginning of the tcp
data or to the beginning of the options at the end of the tcp header?
I think there is a discrepancy - For TCP_WRITE_FLAG_COPY in tcp_write,
it gets set via tcp_create_segment and is set to the beginning of the
options, for other cases, it is set similarly, but later adjusted to
point to the beginning of the data - line 593 -

/* Fix dataptr for the nocopy case */
if ((apiflags & TCP_WRITE_FLAG_COPY) == 0) {
seg->dataptr = (u8_t*)arg + pos;
}

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

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 kieranm (Posted a comment)
  • -unavailable- added by goldsimon (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Mar 2011 01:02:01 PM UTCgoldsimonStatusNone=>Fixed
      Assigned tokieranm=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 11 Feb 2011 09:27:31 AM UTCkieranmAssigned toNone=>kieranm
      Planned Release=>1.4.0

    Back to the top


    Powered by Savane 3.1-cleanup1