inetstack
inetstack copied to clipboard
[ip] Support Compile-Time Switch for Prioritizing Wildcard Address Lookup
Context
When processing incoming packets, we prioritize searching for a socket bound to a specific address rather than searching for a matching socket bound to the wildcard address INADDR_ANY
:
https://github.com/demikernel/inetstack/blob/40c6ffcd260232077cfc4ecc38a2a8cc215f9a5e/src/protocols/udp/peer.rs#L345-L356
The spec does not specify which search should be prioritized over the other, and the current policy may not behave as the majority of other stacks.
Proposed Solution
We should support a compile-time switch that would enable one the choose which searching policy should be prioritized. Furthermore, the default build should be setup to the one matching the behavior of the majority of other stacks.