diff options
author | Damjan Marion <damarion@cisco.com> | 2016-04-29 14:51:57 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-04-29 13:29:27 +0000 |
commit | 1a64ab900f31d69098a18183d13c5359233d0ff9 (patch) | |
tree | 846e17787a2bf9d3db5a2a33fa986a5171b5bfaa | |
parent | 9444c0673c1b0e05e879862329a16c7893d51afc (diff) |
Fix ip4 address formatting in the show ip fib ouptut
Change-Id: I3ffb2e3cef63cbc9f2abc81bbdedabb34b9b3408
Signed-off-by: Damjan Marion <damarion@cisco.com>
-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 720450f0..bf101bba 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 7fbcab14..876ffac0 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, |