inetstack icon indicating copy to clipboard operation
inetstack copied to clipboard

[ip] Support Compile-Time Switch for Prioritizing Wildcard Address Lookup

Open ppenna opened this issue 2 years ago • 1 comments

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.

ppenna avatar Aug 04 '22 12:08 ppenna