BV(clib_bihash_add_del) (&im->ip6_lookup_table, &kv, 1 /* is_add */);
}
+ /* Avoid spurious reference count increments */
+ if (old_adj_index == adj_index)
+ {
+ 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)
/* Adjacency taken. */
u32 adj_index;
u32 flow_hash;
+ u32 fib_index;
/* Packet data, possibly *after* rewrite. */
u8 packet_data[64 - 1*sizeof(u32)];
uword indent = format_get_indent (s);
adj = ip_get_adjacency (&im->lookup_main, t->adj_index);
- s = format (s, "adjacency: %U flow hash: 0x%08x",
- format_ip_adjacency,
+ s = format (s, "fib %d adj-idx %d : %U flow hash: 0x%08x",
+ t->fib_index, t->adj_index, format_ip_adjacency,
vnm, &im->lookup_main, t->adj_index, t->flow_hash);
switch (adj->lookup_next_index)
{
vlib_rx_or_tx_t which_adj_index)
{
u32 * from, n_left;
+ ip6_main_t * im = &ip6_main;
n_left = frame->n_vectors;
from = vlib_frame_vector_args (frame);
t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
t0->adj_index = vnet_buffer (b0)->ip.adj_index[which_adj_index];
t0->flow_hash = vnet_buffer (b0)->ip.flow_hash;
+ t0->fib_index = vec_elt (im->fib_index_by_sw_if_index,
+ vnet_buffer(b0)->sw_if_index[VLIB_RX]);
memcpy (t0->packet_data,
vlib_buffer_get_current (b0),
sizeof (t0->packet_data));
t1 = vlib_add_trace (vm, node, b1, sizeof (t1[0]));
t1->adj_index = vnet_buffer (b1)->ip.adj_index[which_adj_index];
t1->flow_hash = vnet_buffer (b1)->ip.flow_hash;
+ t1->fib_index = vec_elt (im->fib_index_by_sw_if_index,
+ vnet_buffer(b1)->sw_if_index[VLIB_RX]);
memcpy (t1->packet_data,
vlib_buffer_get_current (b1),
sizeof (t1->packet_data));
t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
t0->adj_index = vnet_buffer (b0)->ip.adj_index[which_adj_index];
t0->flow_hash = vnet_buffer (b0)->ip.flow_hash;
+ t0->fib_index = vec_elt (im->fib_index_by_sw_if_index,
+ vnet_buffer(b0)->sw_if_index[VLIB_RX]);
memcpy (t0->packet_data,
vlib_buffer_get_current (b0),
sizeof (t0->packet_data));
#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",
},