jsoninfo: improve the ipc_print_gateways_ipvx function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 5 Mar 2016 20:24:22 +0000 (21:24 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 5 Mar 2016 20:33:42 +0000 (21:33 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index f8e9064..4adacc8 100644 (file)
@@ -507,16 +507,15 @@ static void ipc_print_gateways_ipvx(struct autobuf *abuf, bool ipv6) {
   if (olsr_cnf->smart_gw_active) {
     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)) {
-            continue;
-          }
+    OLSR_FOR_ALL_GATEWAY_ENTRIES(gw) {
+      if (!(!ipv6 && gw->ipv4) && !(ipv6 && gw->ipv6)) {
+        continue;
+      }
 
-          abuf_json_mark_array_entry(true, abuf);
-          ipc_print_gateway_entry(abuf, ipv6, current_gw, gw);
-          abuf_json_mark_array_entry(false, abuf);
-        }OLSR_FOR_ALL_GATEWAY_ENTRIES_END(gw)
+      abuf_json_mark_array_entry(true, abuf);
+      ipc_print_gateway_entry(abuf, ipv6, current_gw, gw);
+      abuf_json_mark_array_entry(false, abuf);
+    OLSR_FOR_ALL_GATEWAY_ENTRIES_END(gw)
   }
 
   abuf_json_mark_object(false, true, abuf, NULL);