[strongSwan-dev] VICI: Minor inconsistency in {ike, child}-updown events

Vit Herman vit at herman.pro
Wed Dec 30 15:31:13 CET 2015


Hi,

I noticed a minor inconsistency in ike- and child-updown events. Even
though the documentation suggests that the value of the "up" parameter
should be "yes or no", it's either up=yes, or the key is omitted.

The trivial patch bellow fixes this.

Best regards,
Vit Herman

---
 src/libcharon/plugins/vici/vici_query.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/libcharon/plugins/vici/vici_query.c b/src/libcharon/plugins/vici/vici_query.c
index e020ebf..697b517 100644
--- a/src/libcharon/plugins/vici/vici_query.c
+++ b/src/libcharon/plugins/vici/vici_query.c
@@ -1314,10 +1314,7 @@ METHOD(listener_t, ike_updown, bool,
 
        b = vici_builder_create();
 
-       if (up)
-       {
-               b->add_kv(b, "up", "yes");
-       }
+       b->add_kv(b, "up", up ? "yes" : "no");
 
        b->begin_section(b, ike_sa->get_name(ike_sa));
        list_ike(this, b, ike_sa, now);
@@ -1372,10 +1369,7 @@ METHOD(listener_t, child_updown, bool,
        now = time_monotonic(NULL);
        b = vici_builder_create();
 
-       if (up)
-       {
-               b->add_kv(b, "up", "yes");
-       }
+       b->add_kv(b, "up", up ? "yes" : "no");
 
        b->begin_section(b, ike_sa->get_name(ike_sa));
        list_ike(this, b, ike_sa, now);
-- 
1.8.4


More information about the Dev mailing list