lwIP - A Lightweight TCP/IP stack - Bugs: bug #60607, IP traffic "leaks"...
You are not allowed to post comments on this tracker with your current authentication level.
bug #60607: IP traffic "leaks" between netifs
Submitter: | Patrik Lantto <patriklantto> | ||
Submitted: | Fri 14 May 2021 08:16:37 PM UTC | ||
Category: | IPv4 | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open | Planned Release: | None |
lwIP version: | git head |
Mon 17 May 2021 03:48:34 PM UTC, comment #5: |
Indan Zupancic <indan> |
Mon 17 May 2021 11:22:59 AM UTC, comment #4:
|
Patrik Lantto <patriklantto> |
Mon 17 May 2021 09:42:26 AM UTC, comment #3: Had a similar situation couple of years ago (see patch #9134).
|
Elias Reichart <alicer> |
Mon 17 May 2021 08:21:20 AM UTC, comment #2: This is standard IP stack behaviour. Keep in mind the same happens for all outgoing packets.
|
Indan Zupancic <indan> |
Sat 15 May 2021 06:14:13 PM UTC, comment #1: The code in question has been there since I started with lwIP some 15 years ago. I don't know the exact reason for it, but I suppose one reason could be to communicate with e.g. the ethernet netif's address from behind a PPP remote host (depending on the routing).
|
Simon Goldschmidt <goldsimon> |
Fri 14 May 2021 08:16:37 PM UTC, original submission:
When multiple netifs are used, IP traffic that is passed (via tcpip_input) to lwIP on one netif can be received on a different netif.
|
Patrik Lantto <patriklantto> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
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.
Powered by Savane 3.13-f8d8.
Corresponding source code
Mind that RFC 1122 still does routing based on src and dst IP addresses, lwIP already makes it possible to do that by implementing LWIP_HOOK_IP4_ROUTE_SRC as a user.
We didn't use that because we needed other things and because we already know the interface, so looking up the interface by address is unnecessary overhead.
Other things we needed to do:
- "Fix" ip4_input().
- Always send ICMP replies over the same interface as the received packet.
- Always send TCP RST back over the same interface as the received packet. (I see patch #9988 fixed this in the meantime.)
- Autobind new pcbs created by tcp_listen_input() to the interface the SYN came from.
- Honour p->if_idx for outgoing UDP packets.
- Change SNMP code to send packets over the configured interface.
We do bind most sockets to specific interfaces/addresses in application code too, except TCP listen sockets and some SNMP UDP sockets.
As this is very specific for our use case (hard separation between interfaces), I am not sure how generally useful this is, though for embedded systems you would expect this to be more common. We could split the above into multiple feature defines instead of one we use now.
What is the lwIP maintainers' opinion about this?