int i, len;
int rv;
BVT(clib_bihash_kv) kv, value;
+ u64 fib;
len = vec_len (im->prefix_lengths_in_search_order);
+ kv.key[0] = dst->as_u64[0];
+ kv.key[1] = dst->as_u64[1];
+ fib = ((u64)((fib_index))<<32);
+
for (i = 0; i < len; i++)
{
int dst_address_length = im->prefix_lengths_in_search_order[i];
ip6_address_t * mask = &im->fib_masks[dst_address_length];
ASSERT(dst_address_length >= 0 && dst_address_length <= 128);
-
- kv.key[0] = dst->as_u64[0] & mask->as_u64[0];
- kv.key[1] = dst->as_u64[1] & mask->as_u64[1];
- kv.key[2] = ((u64)((fib_index))<<32) | dst_address_length;
+ //As lengths are decreasing, masks are increasingly specific.
+ kv.key[0] &= mask->as_u64[0];
+ kv.key[1] &= mask->as_u64[1];
+ kv.key[2] = fib | dst_address_length;
rv = BV(clib_bihash_search_inline_2)(&im->ip6_lookup_table, &kv, &value);
if (rv == 0)
BV(clib_bihash_add_del) (&im->ip6_lookup_table, &kv, 1 /* is_add */);
}
+ /* Avoid spurious reference count increments */
+ if (old_adj_index == adj_index && !(a->flags & IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY))
+ {
+ ip_adjacency_t * adj = ip_get_adjacency (lm, adj_index);
+ if (adj->share_count > 0)
+ adj->share_count --;
+ }
+
/* Delete old adjacency index if present and changed. */
{
if (! (a->flags & IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY)
if (classify_table_index != (u32) ~0)
{
adj->lookup_next_index = IP_LOOKUP_NEXT_CLASSIFY;
- adj->classify_table_index = classify_table_index;
+ adj->classify.table_index = classify_table_index;
}
else
adj->lookup_next_index = IP_LOOKUP_NEXT_LOCAL;
#if DPDK > 0
if (p0)
{
- struct rte_mbuf *mb = ((struct rte_mbuf *)p0)-1;
+ struct rte_mbuf *mb = rte_mbuf_from_vlib_buffer(p0);
u8 nb_segs = mb->nb_segs;
n_this_buffer = (p0->current_length > headers_size ?
error1 = len_diff1 < 0 ? IP6_ERROR_UDP_LENGTH : error1;
ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_UDP == IP6_ERROR_UDP_CHECKSUM);
- ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_TCP == IP6_ERROR_TCP_CHECKSUM);
ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_ICMP == IP6_ERROR_ICMP_CHECKSUM);
error0 = (! good_l4_checksum0
? IP6_ERROR_UDP_CHECKSUM + type0
error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_UDP == IP6_ERROR_UDP_CHECKSUM);
- ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_TCP == IP6_ERROR_TCP_CHECKSUM);
ASSERT (IP6_ERROR_UDP_CHECKSUM + IP_BUILTIN_PROTOCOL_ICMP == IP6_ERROR_ICMP_CHECKSUM);
error0 = (! good_l4_checksum0
? IP6_ERROR_UDP_CHECKSUM + type0
.next_nodes = {
[IP_LOCAL_NEXT_DROP] = "error-drop",
[IP_LOCAL_NEXT_PUNT] = "error-punt",
- // [IP_LOCAL_NEXT_TCP_LOOKUP] = "ip6-tcp-lookup",
[IP_LOCAL_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
[IP_LOCAL_NEXT_ICMP] = "ip6-icmp-input",
},