diff options
author | Neale Ranns <nranns@cisco.com> | 2017-05-30 02:08:14 -0700 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2017-06-01 20:50:39 +0000 |
commit | 7a27274a6137f8952c18c78f039774e5cbb44c71 (patch) | |
tree | c13fb4bcb91c843c004fd28a1186c0be4ce1c714 /src/vnet/ip/ip4_forward.c | |
parent | d6d6751b89ef04f97b5ae0c5f5ce0ee8827cd2c3 (diff) |
Fix 'ip probe' on /32
Change-Id: Ib874ad93357500b2c425d75cf48834264b2183fc
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rwxr-xr-x | src/vnet/ip/ip4_forward.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index d86f22ca..f4ecc395 100755 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -717,28 +717,23 @@ ip4_add_interface_routes (u32 sw_if_index, .fp_addr.ip4 = *address, }; - a->neighbor_probe_adj_index = ~0; - if (pfx.fp_len <= 30) { /* a /30 or shorter - add a glean for the network address */ - fib_node_index_t fei; - - fei = fib_table_entry_update_one_path (fib_index, &pfx, - FIB_SOURCE_INTERFACE, - (FIB_ENTRY_FLAG_CONNECTED | - FIB_ENTRY_FLAG_ATTACHED), - FIB_PROTOCOL_IP4, - /* No next-hop address */ - NULL, - sw_if_index, - // invalid FIB index - ~0, - 1, - // no out-label stack - NULL, - FIB_ROUTE_PATH_FLAG_NONE); - a->neighbor_probe_adj_index = fib_entry_get_adj (fei); + fib_table_entry_update_one_path (fib_index, &pfx, + FIB_SOURCE_INTERFACE, + (FIB_ENTRY_FLAG_CONNECTED | + FIB_ENTRY_FLAG_ATTACHED), + FIB_PROTOCOL_IP4, + /* No next-hop address */ + NULL, + sw_if_index, + // invalid FIB index + ~0, + 1, + // no out-label stack + NULL, + FIB_ROUTE_PATH_FLAG_NONE); /* Add the two broadcast addresses as drop */ fib_prefix_t net_pfx = { @@ -2269,6 +2264,7 @@ ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index) vnet_hw_interface_t *hi; vnet_sw_interface_t *si; vlib_buffer_t *b; + adj_index_t ai; u32 bi = 0; si = vnet_get_sw_interface (vnm, sw_if_index); @@ -2293,12 +2289,17 @@ ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index) sw_if_index); } - adj = adj_get (ia->neighbor_probe_adj_index); + ip46_address_t nh = { + .ip4 = *dst, + }; + + ai = adj_nbr_add_or_lock (FIB_PROTOCOL_IP4, + VNET_LINK_IP4, &nh, sw_if_index); + adj = adj_get (ai); - h = - vlib_packet_template_get_packet (vm, - &im->ip4_arp_request_packet_template, - &bi); + h = vlib_packet_template_get_packet (vm, + &im->ip4_arp_request_packet_template, + &bi); hi = vnet_get_sup_hw_interface (vnm, sw_if_index); @@ -2324,6 +2325,7 @@ ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index) vlib_put_frame_to_node (vm, hi->output_node_index, f); } + adj_unlock (ai); return /* no error */ 0; } |