X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fadj%2Fadj_nbr.c;h=3f73ff9f1d2e1c7ce81b184758ddf9649d7bed7c;hb=ae8098350cb7b96f7495fa4d4180238064256e14;hp=ff535295b4b8e7461c7ae7fde240219dcb984d42;hpb=b7b929931a07fbb27b43d5cd105f366c3e29807e;p=vpp.git diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c index ff535295b4b..3f73ff9f1d2 100644 --- a/src/vnet/adj/adj_nbr.c +++ b/src/vnet/adj/adj_nbr.c @@ -18,6 +18,8 @@ #include #include +#include + /* * Vector Hash tables of neighbour (traditional) adjacencies * Key: interface(for the vector index), address (and its proto), @@ -195,6 +197,8 @@ adj_nbr_alloc (fib_protocol_t nh_proto, adj->ia_link = link_type; adj->ia_nh_proto = nh_proto; adj->rewrite_header.sw_if_index = sw_if_index; + vnet_rewrite_update_mtu(vnet_get_main(), adj->ia_link, + &adj->rewrite_header); adj_nbr_evaluate_feature (adj_get_index(adj)); return (adj); @@ -263,26 +267,24 @@ adj_nbr_add_or_lock_w_rewrite (fib_protocol_t nh_proto, u8 *rewrite) { adj_index_t adj_index; - ip_adjacency_t *adj; adj_index = adj_nbr_find(nh_proto, link_type, nh_addr, sw_if_index); if (ADJ_INDEX_INVALID == adj_index) { - adj = adj_nbr_alloc(nh_proto, link_type, nh_addr, sw_if_index); + ip_adjacency_t *adj; + + adj = adj_nbr_alloc(nh_proto, link_type, nh_addr, sw_if_index); adj->rewrite_header.sw_if_index = sw_if_index; - } - else - { - adj = adj_get(adj_index); + adj_index = adj_get_index(adj); } - adj_lock(adj_get_index(adj)); - adj_nbr_update_rewrite(adj_get_index(adj), + adj_lock(adj_index); + adj_nbr_update_rewrite(adj_index, ADJ_NBR_REWRITE_FLAG_COMPLETE, rewrite); - return (adj_get_index(adj)); + return (adj_index); } /**