vlib_main_t *vm = vlib_get_main ();
ip6_neighbor_sw_interface_add_del (vnm, sw_if_index, 0 /* is_add */ );
+ vnet_sw_interface_update_unnumbered (sw_if_index, ~0, 0);
/* *INDENT-OFF* */
- foreach_ip_interface_address (lm6, ia, sw_if_index, 1 /* honor unnumbered */,
+ foreach_ip_interface_address (lm6, ia, sw_if_index, 0,
({
address = ip_interface_address_get_address (lm6, ia);
ip6_add_del_interface_address(vm, sw_if_index, address, ia->address_length, 1);
{
const load_balance_t *lb0;
index_t lbi;
+ u32 fib_index;
- lbi = ip6_fib_table_fwding_lookup_with_if_index (im,
- vnet_buffer
- (b)->sw_if_index[VLIB_RX],
- &i->src_address);
+ fib_index = vec_elt (im->fib_index_by_sw_if_index,
+ vnet_buffer (b)->sw_if_index[VLIB_RX]);
+ fib_index =
+ (vnet_buffer (b)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+ fib_index : vnet_buffer (b)->sw_if_index[VLIB_TX];
+ lbi = ip6_fib_table_fwding_lookup (im, fib_index, &i->src_address);
lb0 = load_balance_get (lbi);
return (fib_urpf_check_size (lb0->lb_urpf));
[IP_LOCAL_NEXT_PUNT] = "ip6-punt",
[IP_LOCAL_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
[IP_LOCAL_NEXT_ICMP] = "ip6-icmp-input",
- [IP_LOCAL_NEXT_REASSEMBLY] = "ip6-reassembly",
},
};
/* *INDENT-ON* */
* Choose source address based on destination lookup
* adjacency.
*/
- if (ip6_src_address_for_packet (lm,
- sw_if_index0,
- &h0->ip.src_address))
+ if (!ip6_src_address_for_packet (lm,
+ sw_if_index0,
+ &ip0->dst_address,
+ &h0->ip.src_address))
{
/* There is no address on the interface */
p0->error =
IP6_REWRITE_NEXT_ICMP_ERROR,
} ip6_rewrite_next_t;
+/**
+ * This bits of an IPv6 address to mask to construct a multicast
+ * MAC address
+ */
+#define IP6_MCAST_ADDR_MASK 0xffffffff
+
always_inline uword
ip6_rewrite_inline (vlib_main_t * vm,
vlib_node_runtime_t * node,
/*
* copy bytes from the IP address into the MAC rewrite
*/
- vnet_fixup_one_header (adj0[0], &ip0->dst_address, ip0);
- vnet_fixup_one_header (adj1[0], &ip1->dst_address, ip1);
+ vnet_ip_mcast_fixup_header (IP6_MCAST_ADDR_MASK,
+ adj0->
+ rewrite_header.dst_mcast_offset,
+ &ip0->dst_address.as_u32[3],
+ (u8 *) ip0);
+ vnet_ip_mcast_fixup_header (IP6_MCAST_ADDR_MASK,
+ adj1->
+ rewrite_header.dst_mcast_offset,
+ &ip1->dst_address.as_u32[3],
+ (u8 *) ip1);
}
vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
}
if (is_mcast)
{
- vnet_fixup_one_header (adj0[0], &ip0->dst_address, ip0);
+ vnet_ip_mcast_fixup_header (IP6_MCAST_ADDR_MASK,
+ adj0->
+ rewrite_header.dst_mcast_offset,
+ &ip0->dst_address.as_u32[3],
+ (u8 *) ip0);
}
p0->error = error_node->errors[error0];
ip6_main_t *im = &ip6_main;
ip6_hop_by_hop_main_t *hm = &ip6_hop_by_hop_main;
- ASSERT (option < ARRAY_LEN (hm->options));
+ ASSERT ((u32) option < ARRAY_LEN (hm->options));
/* Already registered */
if (hm->options[option])
ip6_main_t *im = &ip6_main;
ip6_hop_by_hop_main_t *hm = &ip6_hop_by_hop_main;
- ASSERT (option < ARRAY_LEN (hm->options));
+ ASSERT ((u32) option < ARRAY_LEN (hm->options));
/* Not registered */
if (!hm->options[option])