diff options
author | Florin Coras <fcoras@cisco.com> | 2018-01-30 03:21:32 -0800 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2018-01-30 23:53:02 -0800 |
commit | cba3675fabe618194bf80a9de0e9c53b89a541ca (patch) | |
tree | 408cb2cde5aa7dbe5a26d4bcdf9327c47de38a2b | |
parent | a7effa1b072463f12305a474f082aeaffb7ada4b (diff) |
lisp-cp: fix handling of ndp without source link addr VPP-1159
Change-Id: Idddb60bbc7fcc701d39212f6422a6b2f6dc75221
Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r-- | src/vnet/lisp-cp/control.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c index c1edc3a9315..b2c8cd0dfaa 100644 --- a/src/vnet/lisp-cp/control.c +++ b/src/vnet/lisp-cp/control.c @@ -3309,11 +3309,18 @@ get_src_and_dst_eids_from_buffer (lisp_cp_main_t * lcm, vlib_buffer_t * b, if (clib_net_to_host_u16 (eh->type) == ETHERNET_TYPE_ARP) { ah = (ethernet_arp_header_t *) (((u8 *) eh) + sizeof (*eh)); + gid_address_type (dst) = GID_ADDR_ARP; + if (clib_net_to_host_u16 (ah->opcode) != ETHERNET_ARP_OPCODE_request) - return; + { + memset (&gid_address_arp_ndp_ip (dst), 0, + sizeof (ip_address_t)); + ip_addr_version (&gid_address_arp_ndp_ip (dst)) = IP4; + gid_address_arp_ndp_bd (dst) = ~0; + return; + } - gid_address_type (dst) = GID_ADDR_ARP; gid_address_arp_bd (dst) = lisp_get_bd_from_buffer_eth (b); clib_memcpy (&gid_address_arp_ip4 (dst), &ah->ip4_over_ethernet[1].ip4, 4); @@ -3331,13 +3338,23 @@ get_src_and_dst_eids_from_buffer (lisp_cp_main_t * lcm, vlib_buffer_t * b, ndh = ip6_next_header (ip); if (ndh->icmp.type == ICMP6_neighbor_solicitation) { + gid_address_type (dst) = GID_ADDR_NDP; + + /* check that source link layer address option is present */ opt = (void *) (ndh + 1); if ((opt->header.type != ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address) || (opt->header.n_data_u64s != 1)) - return; /* source link layer address option not present */ + { + memset (&gid_address_arp_ndp_ip (dst), 0, + sizeof (ip_address_t)); + ip_addr_version (&gid_address_arp_ndp_ip (dst)) = + IP6; + gid_address_arp_ndp_bd (dst) = ~0; + gid_address_type (src) = GID_ADDR_NO_ADDRESS; + return; + } - gid_address_type (dst) = GID_ADDR_NDP; gid_address_ndp_bd (dst) = lisp_get_bd_from_buffer_eth (b); ip_address_set (&gid_address_arp_ndp_ip (dst), |