summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-08-09 20:53:09 -0400
committerDave Barach <openvpp@barachs.net>2016-08-10 13:43:03 +0000
commitf43f6df44f2325af53e912d6a16a36cbec14173e (patch)
treec086af19e6c81ab3a829bcacf476276cb24ac215
parent2bd44b7cdd49188da46ea85c4ab64d38d1e586f4 (diff)
VPP-313: Wrong API dump message in vxlan_add_del_tunnel
Fix API custom-dump format of ip4/ip6 addresses in the message. Change-Id: I822e036691846ce6a437834df933c44098944c1f Signed-off-by: John Lo <loj@cisco.com>
-rw-r--r--vpp/vpp-api/custom_dump.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c
index e97a2c179c4..51bb00bb2b4 100644
--- a/vpp/vpp-api/custom_dump.c
+++ b/vpp/vpp-api/custom_dump.c
@@ -1380,13 +1380,20 @@ static void *vl_api_vxlan_add_del_tunnel_t_print
s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
- s = format (s, "dst %U ", format_ip46_address,
- (ip46_address_t *) & (mp->dst_address),
- mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
-
- s = format (s, "src %U ", format_ip46_address,
- (ip46_address_t *) & (mp->src_address),
- mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
+ if (mp->is_ipv6)
+ {
+ s = format (s, "src %U ", format_ip6_address,
+ (ip6_address_t *) mp->src_address);
+ s = format (s, "dst %U ", format_ip6_address,
+ (ip6_address_t *) mp->dst_address);
+ }
+ else
+ {
+ s = format (s, "src %U ", format_ip4_address,
+ (ip4_address_t *) mp->src_address);
+ s = format (s, "dst %U ", format_ip4_address,
+ (ip4_address_t *) mp->dst_address);
+ }
if (mp->encap_vrf_id)
s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));