aboutsummaryrefslogtreecommitdiffstats
path: root/src/swanctl
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2016-05-05 14:53:22 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2016-05-05 14:53:22 +0200
commitb9522f9d64371c9b620f398852e4ade857105974 (patch)
treed8e404ca2b0ed30e5191265719f7a53da7e582ff /src/swanctl
parentd95f2ab0cfa20fb0fa47d2387b5e59ba24e4563b (diff)
downloadstrongswan-b9522f9d64371c9b620f398852e4ade857105974.tar.bz2
strongswan-b9522f9d64371c9b620f398852e4ade857105974.tar.xz
swanctl: Do not display rekey times for shunts
Diffstat (limited to 'src/swanctl')
-rw-r--r--src/swanctl/commands/list_conns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/swanctl/commands/list_conns.c b/src/swanctl/commands/list_conns.c
index 6167a45da..19e7050da 100644
--- a/src/swanctl/commands/list_conns.c
+++ b/src/swanctl/commands/list_conns.c
@@ -83,7 +83,7 @@ CALLBACK(children_sn, int,
hashtable_t *ike, vici_res_t *res, char *name)
{
hashtable_t *child;
- char *interface, *priority;
+ char *mode, *interface, *priority;
char *rekey_time, *rekey_bytes, *rekey_packets;
bool no_time, no_bytes, no_packets, or = FALSE;
int ret;
@@ -92,7 +92,8 @@ CALLBACK(children_sn, int,
ret = vici_parse_cb(res, NULL, values, list, child);
if (ret == 0)
{
- printf(" %s: %s, ", name, child->get(child, "mode"));
+ mode = child->get(child, "mode");
+ printf(" %s: %s, ", name, mode);
rekey_time = child->get(child, "rekey_time");
rekey_bytes = child->get(child, "rekey_bytes");
@@ -101,7 +102,8 @@ CALLBACK(children_sn, int,
no_bytes = streq(rekey_bytes, "0");
no_packets = streq(rekey_packets, "0");
- if (no_time && no_bytes && no_packets)
+ if (strcaseeq(mode, "PASS") || strcaseeq(mode, "DROP") ||
+ (no_time && no_bytes && no_packets))
{
printf("no rekeying\n");
}