diff options
author | Artem Glazychev <artem.glazychev@xored.com> | 2021-08-23 13:35:31 +0700 |
---|---|---|
committer | Ed Warnicke <hagbard@gmail.com> | 2021-10-06 21:34:31 +0000 |
commit | 5b5b89a046dff506756a2d56a5596009858570e8 (patch) | |
tree | 06ad5ac255fe9a22fad35ce008be2454125e150a | |
parent | dd630d15d3e9d13da9ed98d3171b9ec4529e4e66 (diff) |
ip: check if interface has link-local address (addition)
previous - b31fbc47f5fcf8234c757558d7b0285348774086
Type: fix
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I7ea2d693d3ad5bf41ece066b3511fbfa156c1e4b
-rw-r--r-- | src/vnet/ip/ip_sas.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vnet/ip/ip_sas.c b/src/vnet/ip/ip_sas.c index 7d3632d95ed..0fc261724f1 100644 --- a/src/vnet/ip/ip_sas.c +++ b/src/vnet/ip/ip_sas.c @@ -80,7 +80,12 @@ ip6_sas_by_sw_if_index (u32 sw_if_index, const ip6_address_t *dst, if (ip6_address_is_link_local_unicast (dst) || dst->as_u32[0] == clib_host_to_net_u32 (0xff020000)) { - ip6_address_copy (src, ip6_get_link_local_address (sw_if_index)); + const ip6_address_t *ll = ip6_get_link_local_address (sw_if_index); + if (NULL == ll) + { + return false; + } + ip6_address_copy (src, ll); return true; } |