net: if: Add ASSERT in net_if_ipv4/6_select_src_addr
Add an assert for the destination address provided to find the best source address. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
3300b31de8
commit
cb4fb765f0
1 changed files with 4 additions and 0 deletions
|
@ -2864,6 +2864,8 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface,
|
|||
const struct in6_addr *src = NULL;
|
||||
uint8_t best_match = 0U;
|
||||
|
||||
NET_ASSERT(dst);
|
||||
|
||||
if (!net_ipv6_is_ll_addr(dst) && !net_ipv6_is_addr_mcast_link(dst)) {
|
||||
/* If caller has supplied interface, then use that */
|
||||
if (dst_iface) {
|
||||
|
@ -3405,6 +3407,8 @@ const struct in_addr *net_if_ipv4_select_src_addr(struct net_if *dst_iface,
|
|||
const struct in_addr *src = NULL;
|
||||
uint8_t best_match = 0U;
|
||||
|
||||
NET_ASSERT(dst);
|
||||
|
||||
if (!net_ipv4_is_ll_addr(dst)) {
|
||||
|
||||
/* If caller has supplied interface, then use that */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue