X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fudp%2Fudp_encap.c;h=0b1d3d7125b1cef4f74ebcdb40679ff04a996542;hb=0765d97abef74727c040d2eaf9112865d59f1593;hp=072bc79c8af7f51908b968390c48ff161d5923b4;hpb=9c0a3c423ee0b9326f600a00c1bd46fef45d4975;p=vpp.git diff --git a/src/vnet/udp/udp_encap.c b/src/vnet/udp/udp_encap.c index 072bc79c8af..0b1d3d7125b 100644 --- a/src/vnet/udp/udp_encap.c +++ b/src/vnet/udp/udp_encap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Cisco and/or its affiliates. + * Copyright (c) 2017-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -117,14 +118,10 @@ udp_encap_add_and_lock (fib_protocol_t proto, .fp_addr = *dst_ip, }; - ue->ue_fib_entry_index = - fib_table_entry_special_add (fib_index, - &dst_pfx, - FIB_SOURCE_RR, FIB_ENTRY_FLAG_NONE); - ue->ue_fib_sibling = - fib_entry_child_add (ue->ue_fib_entry_index, - FIB_NODE_TYPE_UDP_ENCAP, uei); - + ue->ue_fib_entry_index = fib_entry_track (fib_index, + &dst_pfx, + FIB_NODE_TYPE_UDP_ENCAP, + uei, &ue->ue_fib_sibling); udp_encap_restack (ue); return (uei); @@ -211,7 +208,7 @@ format_udp_encap_i (u8 * s, va_list * args) ue = udp_encap_get (uei); // FIXME - s = format (s, "udp-ecap:[%d]: ip-fib-index:%d ", uei, ue->ue_fib_index); + s = format (s, "udp-encap:[%d]: ip-fib-index:%d ", uei, ue->ue_fib_index); if (FIB_PROTOCOL_IP4 == ue->ue_ip_proto) { s = format (s, "ip:[src:%U, dst:%U] udp:[src:%d, dst:%d]", @@ -322,9 +319,7 @@ udp_encap_fib_last_lock_gone (fib_node_t * node) */ dpo_reset (&ue->ue_dpo); - fib_entry_child_remove (ue->ue_fib_entry_index, ue->ue_fib_sibling); - fib_table_entry_delete_index (ue->ue_fib_entry_index, FIB_SOURCE_RR); - + fib_entry_untrack (ue->ue_fib_entry_index, ue->ue_fib_sibling); pool_put (udp_encap_pool, ue); }