smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.81k stars 432 forks source link

Use own source address for ARP and NDISC Solicitations #984

Closed thvdveld closed 2 months ago

thvdveld commented 2 months ago

When looking up the destination link-layer address for a given destination address, we need to send an ARP or ICMPv6 Neighbor Solicitation if the destination link-layer address is not in the cache.

When transmitting an ARP or ICMPv6 Neighbor Solicitation packet, use the source address of the interface instead of the source address of the packet that is tried to be sent.

By using the source address of the interface, we are sure that a response will be received on the same interface.

Fixes #940 .