diff options
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/ip/ip4_forward.c | 1 | ||||
-rw-r--r-- | vnet/vnet/ip/ip6_packet.h | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c index 720450f01ab..bf101bbadab 100644 --- a/vnet/vnet/ip/ip4_forward.c +++ b/vnet/vnet/ip/ip4_forward.c @@ -974,6 +974,7 @@ void ip4_adjacency_set_interface_route (vnet_main_t * vnm, node_index = ip4_arp_node.index; adj->if_address_index = if_address_index; adj->arp.next_hop.ip4.as_u32 = 0; + ip46_address_reset(&adj->arp.next_hop); packet_type = VNET_L3_PACKET_TYPE_ARP; } else diff --git a/vnet/vnet/ip/ip6_packet.h b/vnet/vnet/ip/ip6_packet.h index 7fbcab14eac..876ffac0cdc 100644 --- a/vnet/vnet/ip/ip6_packet.h +++ b/vnet/vnet/ip/ip6_packet.h @@ -64,10 +64,12 @@ typedef CLIB_PACKED (union { ip4_address_t ip4; }; ip6_address_t ip6; + u64 as_u64[2]; }) ip46_address_t; -#define ip46_address_is_ip4(ip46) (((ip46)->pad[0] | (ip46)->pad[1] | (ip46)->pad[2]) == 0) -#define ip46_address_mask_ip4(ip46) ((ip46)->pad[0] = (ip46)->pad[1] = (ip46)->pad[2] = 0) -#define ip46_address_set_ip4(ip46, ip) (ip46_address_mask_ip4(ip46), (ip46)->ip4 = (ip)[0]) +#define ip46_address_is_ip4(ip46) (((ip46)->pad[0] | (ip46)->pad[1] | (ip46)->pad[2]) == 0) +#define ip46_address_mask_ip4(ip46) ((ip46)->pad[0] = (ip46)->pad[1] = (ip46)->pad[2] = 0) +#define ip46_address_set_ip4(ip46, ip) (ip46_address_mask_ip4(ip46), (ip46)->ip4 = (ip)[0]) +#define ip46_address_reset(ip46) ((ip46)->as_u64[0] = (ip46)->as_u64[1] = 0) always_inline void ip6_addr_fib_init (ip6_address_fib_t * addr_fib, ip6_address_t * address, |