patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9208, raw: core API extensions

 
 

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

patch #9208: raw: core API extensions

Submitter:  David van Moolenbroek <dcvmoole>
Submitted:  Thu 05 Jan 2017 06:59:15 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Planned Release:  None

Sun 08 Jan 2017 06:30:49 PM UTC, comment #1: 

Very nice, David! Thank you very much for your work!

Dirk Ziegelmeier <dziegel>
Group administrator
Thu 05 Jan 2017 06:59:15 PM UTC, original submission:  

While I am a fairly heavy user of the raw core API [*] due to application requirements, it seems to me that many people aren't, and that the RAW implementation has fallen a bit behind the UDP implementation as a result. This is a proposal for some improvements. The first two bring the RAW implementation closer to the UDP implementation; the third one is exclusive to RAW PCBs.

0001-raw-extend-support-for-connected-sockets: This patch adds proper support for "connected" RAW PCBs, in that 1) packets with different source addresses are now filtered, like UDP PCBs and as is standard; 2) one can tell from a new flag whether the socket is connected (eg for getpeername), again like UDP PCBs; and, 3) there is now actually a raw_disconnect() function, and not just dead references to it in documentation :)

0002-raw-split-off-raw_sendto_if_src-from-raw_sendto: the UDP core API has a whole range of sendto alternatives. This patch adds one of those, which may be used to implement for example IPV6_PKTINFO. As I found out the hard way, an approach of temporary raw_bind()s is no usable substitute for that.

0003-raw-core-support-for-IP_HDRINCL-socket-option: The IP_HDRINCL socket option, to indicate that sent raw packets already include an IP(v4) header, is important for at least traditional implementations of utilities like traceroute. So far I had to support these utilities by keeping a shadow flag and bypassing raw sockets altogether, which is obviously not great. I was going to propose a raw_sendto_hdrincl() until I noticed how little code it takes to add full-blown support for this option, using an additional RAW PCB flag. Note that in its current form, this patch depends on the other two.

As always, I'd be happy to make modifications if that helps.

[*] I, for one, would like to see a rename from "raw API" to "core API" altogether. To be sure: in this post, "raw" refers to raw sockets/pcbs, not the lower-level lwIP (core) API.

David van Moolenbroek <dcvmoole>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by dcvmoole (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-08 dziegel StatusNone Done
        Open/ClosedOpen Closed
    2017-01-05 dcvmoole Attached File- Added 0001-raw-extend-support-for-connected-sockets.patch, #39371
        Attached File- Added 0003-raw-core-support-for-IP_HDRINCL-socket-option.patch, #39372
        Attached File- Added 0002-raw-split-off-raw_sendto_if_src-from-raw_sendto.patch, #39373

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code