jsoninfo: improve the skip condition in ipc_print_gateways_ipvx
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 5 Mar 2016 20:33:07 +0000 (21:33 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 6 Mar 2016 09:50:39 +0000 (10:50 +0100)
Make it more readable, all the negations were confusing.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 4adacc8..591edbb 100644 (file)
@@ -508,7 +508,8 @@ static void ipc_print_gateways_ipvx(struct autobuf *abuf, bool ipv6) {
     struct gateway_entry * current_gw = olsr_get_inet_gateway(ipv6);
     struct gateway_entry * gw;
     OLSR_FOR_ALL_GATEWAY_ENTRIES(gw) {
-      if (!(!ipv6 && gw->ipv4) && !(ipv6 && gw->ipv6)) {
+      if ((!ipv6 && !gw->ipv4) || (ipv6 && !gw->ipv6)) {
+        /* gw does not advertise the requested IP version */
         continue;
       }