[RFC] Pick underlying UDP egress interface based on routing priority #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By now there are many ways available in which an ESP can be connected to IP networks. Notably wired Ethernet and PPP as used for cellular connections are quite popular.
Adjust UDP egress interface selection to pick from all available netifs based on their routing priority. This ensures all types of IP interfaces can be used.
Possibly the logic here can still be improved quite a bit. I.e. when there is a remote endpoint in a network locally attached to one of the netifs. Possibly it would even make sense to react to interface up/down (STA/Ethernet connect) and IP address change (GOT_IP/LOST_OP) event and reevaluate the choice of interface then.
I think I would also like to see a config option to override the lower layer interface used in the config struct. esp-idf provides a great deal of options for traffic steering and seeing those reflected here would be awesome.
If anyone is interested I might look into those options :)