Skip to content
Commit a909b538 authored by Robert Lubos's avatar Robert Lubos Committed by Benjamin Cabé
Browse files

net: ipv4: Rework source address matching for LL addresses



Currently we blindly return the LL address found on the default
interface or else on the first interface that has a valid LL address
configured.

This doesn't work well, if different interfaces have LL addresses
configured with a different subnet mask. Therefore, instead of blindly
selecting the address based on the first LL address encountered, use
net_if_ipv4_get_best_match() function for LL addresses to find the best
match for the given interface.

The rework takes into account current behavior, i. e. default interface
still gets the preference if there is no better candidate.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 9db7f8d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment