patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9006, Prefer non-same interfaces in IPv4...

 
 

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

patch #9006: Prefer non-same interfaces in IPv4 routing

Submitter:  Brian Armstrong <brian_armstrong>
Submitted:  Sat 21 May 2016 01:19:00 AM UTC
   
 
Category:  IPv4 Priority:  3 - Low
Status:  Wont Do Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Mon 23 May 2016 08:00:45 AM UTC, comment #1: 

I'm sorry to turn you down, but "dest == netif->ip_addr" is used for loopback traffic.

Additionally:
- we don't want to support 2 netifs in the same subnet if it could have negative impacts on default use cases (in this case, more code, lower speed)
- IP routing is meant for IP routing, not for network bridging.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 21 May 2016 01:19:00 AM UTC, original submission:  

Hi!

I love this project. It's going to be perfect for what I need. I'm writing an entirely software-based device -- there's no hardware component to my eth except for a D/A converter and an amp.

I was testing my new device driver in a sort of virtualized way, with two interfaces added (via netif_add) on the same subnet. I then forward data between these devices over virtual links. I suspect this a relatively common way of bootstrapping for soft devices, however uncommon this use case might be.

Unfortunately, when you bootstrap this way, the default routing behavior causes lwIP to always prefer one interface, meaning that it's possible to send from interface A to B, but not B to A (since we're really sending A to A, in that case).

I humbly submit this as an easy fix to the issue. When routing, we will prefer a non-same interface, that is, an interface with a different address than the destination. We will still fall back to the same one if no other suitable interface is found. I suspect this yields mostly the same behavior in lwIP, except that this particular sort of bootstrapping is now much easier to test.

Cheers.

Brian Armstrong <brian_armstrong>

 

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

Attached Files
file #37219:  patch.txt added by brian_armstrong (949B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by brian_armstrong (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-23 goldsimon StatusNone Wont Do
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2016-05-21 brian_armstrong Attached File- Added patch.txt, #37219

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code