aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec
diff options
context:
space:
mode:
authorGuillaume Solignac <gsoligna@cisco.com>2019-05-20 15:58:46 +0200
committerNeale Ranns <nranns@cisco.com>2019-06-04 15:20:56 +0000
commit5f08ab6493e1420d84c03d0b62431ac3a6de4ce9 (patch)
treedc20925d665ec8710761c0ce2f122a4413f5b8db /src/vnet/ipsec
parentc602b384ac022f70690a3a7c711149f7cb63ad12 (diff)
Fix: bug prevented IPsec ipv4 SPDs to show correctly
Because of the initialisation of the end of the range, the command show ipsec spd on an ipv4 SPD didn't work correctly. Change-Id: I3582382197bb6edef4fb077aac1e927ef4581cbf Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Diffstat (limited to 'src/vnet/ipsec')
-rw-r--r--src/vnet/ipsec/ipsec_format.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index 284dd6f5513..5bcfcdbeff1 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -155,6 +155,7 @@ u8 *
format_ipsec_policy (u8 * s, va_list * args)
{
u32 pi = va_arg (*args, u32);
+ ip46_type_t ip_type = IP46_TYPE_IP4;
ipsec_main_t *im = &ipsec_main;
ipsec_policy_t *p;
vlib_counter_t counts;
@@ -177,15 +178,19 @@ format_ipsec_policy (u8 * s, va_list * args)
{
s = format (s, " sa %u", p->sa_id);
}
+ if (p->is_ipv6)
+ {
+ ip_type = IP46_TYPE_IP6;
+ }
s = format (s, "\n local addr range %U - %U port range %u - %u",
- format_ip46_address, &p->laddr.start, IP46_TYPE_ANY,
- format_ip46_address, &p->laddr.stop, IP46_TYPE_ANY,
+ format_ip46_address, &p->laddr.start, ip_type,
+ format_ip46_address, &p->laddr.stop, ip_type,
clib_net_to_host_u16 (p->lport.start),
clib_net_to_host_u16 (p->lport.stop));
s = format (s, "\n remote addr range %U - %U port range %u - %u",
- format_ip46_address, &p->raddr.start, IP46_TYPE_ANY,
- format_ip46_address, &p->raddr.stop, IP46_TYPE_ANY,
+ format_ip46_address, &p->raddr.start, ip_type,
+ format_ip46_address, &p->raddr.stop, ip_type,
clib_net_to_host_u16 (p->rport.start),
clib_net_to_host_u16 (p->rport.stop));