X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fgre%2Fgre.c;h=439c542b291dce893bc7434d4891eb603df38c01;hb=e6b83059af3365ab12bbe93655a7dea6f691dbda;hp=db16fa979cc82e9609d67ac1a0e1937a00941a2c;hpb=07bbaef593939e9d03ba131e03296587472514ce;p=vpp.git diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c index db16fa979cc..439c542b291 100644 --- a/src/vnet/gre/gre.c +++ b/src/vnet/gre/gre.c @@ -339,7 +339,7 @@ gre46_fixup (vlib_main_t * vm, * at the midchain node */ ip0->ip6.payload_length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) - - sizeof (*ip0)); + sizeof (ip0->ip6)); tunnel_encap_fixup_4o6 (flags, (ip4_header_t *) (ip0 + 1), &ip0->ip6); } @@ -357,7 +357,7 @@ gre66_fixup (vlib_main_t * vm, * at the midchain node */ ip0->ip6.payload_length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) - - sizeof (*ip0)); + sizeof (ip0->ip6)); tunnel_encap_fixup_6o6 (flags, (ip6_header_t *) (ip0 + 1), &ip0->ip6); } @@ -365,15 +365,15 @@ static void grex6_fixup (vlib_main_t * vm, const ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data) { - ip6_header_t *ip0; + ip6_and_gre_header_t *ip0; ip0 = vlib_buffer_get_current (b0); /* Fixup the payload length field in the GRE tunnel encap that was applied * at the midchain node */ - ip0->payload_length = + ip0->ip6.payload_length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) - - sizeof (*ip0)); + sizeof (ip0->ip6)); } /** @@ -472,7 +472,8 @@ mgre_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai) ti = gm->tunnel_index_by_sw_if_index[sw_if_index]; t = pool_elt_at_index (gm->tunnels, ti); - ne = teib_entry_find (sw_if_index, &adj->sub_type.nbr.next_hop); + ne = teib_entry_find_46 (sw_if_index, + adj->ia_nh_proto, &adj->sub_type.nbr.next_hop); if (NULL == ne) // no NHRP entry to provide the next-hop