[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #65581] UDP Socket Bind Should Bind To Device
From: |
Matt Grochowalski |
Subject: |
[lwip-devel] [bug #65581] UDP Socket Bind Should Bind To Device |
Date: |
Wed, 10 Apr 2024 16:40:20 -0400 (EDT) |
Follow-up Comment #2, bug #65581 (group lwip):
Linux behaves the same way.
Example setup:
Shell:
sudo ip link add veth1 type veth peer name veth2
sudo ip addr add 192.168.7.1/24 dev veth1
sudo ip link set veth1 up
sudo ip link set veth2 up
Start Wireshark capture on interface veth2
Run in Python:
import socket
sock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
sock.bind( ( '192.168.7.1', 1234 ) )
sock.sendto( b'1234', ( '224.0.0.1', 1234 ) )
Result:
Send succeeds and packet from 192.168.7.1 to 224.0.0.1 is shown in Wireshark
I see now there is a fairly trivial way to get this working by defining a
LWIP_HOOK_IP4_ROUTE_SRC hook that returns the adapter with IP matching src.
But it would be nice to have an option to make this work like other socket
implementations.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?65581>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/