Skip to content
Permalink
Browse files

net: if: Select global IPv4 address if needed

The net_if_ipv4_select_src_addr() should return global address
in the interface if nothing else is being found.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed May 20, 2019
1 parent 426764e commit 6f79b019c441e04f7f43a052ea46576b2ebc87b3
Showing with 6 additions and 0 deletions.
  1. +6 −0 subsys/net/ip/net_if.c
@@ -2429,6 +2429,12 @@ const struct in_addr *net_if_ipv4_select_src_addr(struct net_if *dst_iface,
}

if (!src) {
src = net_if_ipv4_get_global_addr(dst_iface,
NET_ADDR_PREFERRED);
if (src) {
return src;
}

return net_ipv4_unspecified_address();
}

0 comments on commit 6f79b01

Please sign in to comment.
You can’t perform that action at this time.