- When receiving a packet on an unconnected UDP socket bound to
0.0.0.0
/INADDR_ANY
, how can I determine what the local IP it was sent to? - Can I determine what interface it was received on?
- Can this be also be done for connection-oriented sockets such as TCP?
Update0
- Platform is Linux, so language is irrelevant but C is native.
- UDP sockets are bound to
INADDR_ANY
host, sogetsockname()
returns0.0.0.0
.