bfd: fix NULL dereference in bfd_api_verify_common 65/34765/3
authorFrédéric Perrin <fred@fperrin.net>
Fri, 17 Dec 2021 14:38:38 +0000 (14:38 +0000)
committerDamjan Marion <dmarion@me.com>
Sat, 18 Dec 2021 12:14:00 +0000 (12:14 +0000)
ip6_get_link_local_address() may return NULL if the local interface
is not (or not yet) configured

Type: fix
Signed-off-by: Frédéric Perrin <fred@fperrin.net>
Change-Id: I42bf2081582c4a36fa4e32145ca2f0ff73488110

src/vnet/bfd/bfd_udp.c

index 4ad5660..333b321 100644 (file)
@@ -614,7 +614,7 @@ bfd_udp_validate_api_input (u32 sw_if_index,
        {
          const ip6_address_t *ll_addr;
          ll_addr = ip6_get_link_local_address (sw_if_index);
-         if (ip6_address_is_equal (ll_addr, &local_addr->ip6))
+         if (ll_addr && ip6_address_is_equal (ll_addr, &local_addr->ip6))
            {
              /* valid address for this interface */
              local_ip_valid = 1;