aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-04-29 14:51:57 +0200
committerDave Barach <openvpp@barachs.net>2016-04-29 13:29:27 +0000
commit1a64ab900f31d69098a18183d13c5359233d0ff9 (patch)
tree846e17787a2bf9d3db5a2a33fa986a5171b5bfaa
parent9444c0673c1b0e05e879862329a16c7893d51afc (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.c1
-rw-r--r--vnet/vnet/ip/ip6_packet.h8
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,