@ -3275,7 +3275,8 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface,
@@ -3275,7 +3275,8 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface,
IPV6_PREFER_SRC_PUBTMP_DEFAULT ) ;
}
struct net_if * net_if_ipv6_select_src_iface ( const struct in6_addr * dst )
struct net_if * net_if_ipv6_select_src_iface_addr ( const struct in6_addr * dst ,
const struct in6_addr * * src_addr )
{
struct net_if * iface = NULL ;
const struct in6_addr * src ;
@ -3285,6 +3286,10 @@ struct net_if *net_if_ipv6_select_src_iface(const struct in6_addr *dst)
@@ -3285,6 +3286,10 @@ struct net_if *net_if_ipv6_select_src_iface(const struct in6_addr *dst)
net_if_ipv6_addr_lookup ( src , & iface ) ;
}
if ( src_addr ! = NULL ) {
* src_addr = src ;
}
if ( iface = = NULL ) {
iface = net_if_get_default ( ) ;
}
@ -3292,6 +3297,11 @@ struct net_if *net_if_ipv6_select_src_iface(const struct in6_addr *dst)
@@ -3292,6 +3297,11 @@ struct net_if *net_if_ipv6_select_src_iface(const struct in6_addr *dst)
return iface ;
}
struct net_if * net_if_ipv6_select_src_iface ( const struct in6_addr * dst )
{
return net_if_ipv6_select_src_iface_addr ( dst , NULL ) ;
}
# if defined(CONFIG_NET_NATIVE_IPV6)
uint32_t net_if_ipv6_calc_reachable_time ( struct net_if_ipv6 * ipv6 )
@ -3600,7 +3610,8 @@ out:
@@ -3600,7 +3610,8 @@ out:
return ret ;
}
struct net_if * net_if_ipv4_select_src_iface ( const struct in_addr * dst )
struct net_if * net_if_ipv4_select_src_iface_addr ( const struct in_addr * dst ,
const struct in_addr * * src_addr )
{
struct net_if * selected = NULL ;
const struct in_addr * src ;
@ -3614,9 +3625,18 @@ struct net_if *net_if_ipv4_select_src_iface(const struct in_addr *dst)
@@ -3614,9 +3625,18 @@ struct net_if *net_if_ipv4_select_src_iface(const struct in_addr *dst)
selected = net_if_get_default ( ) ;
}
if ( src_addr ! = NULL ) {
* src_addr = src ;
}
return selected ;
}
struct net_if * net_if_ipv4_select_src_iface ( const struct in_addr * dst )
{
return net_if_ipv4_select_src_iface_addr ( dst , NULL ) ;
}
static uint8_t get_diff_ipv4 ( const struct in_addr * src ,
const struct in_addr * dst )
{