jsoninfo: minor improvement to /sgw printing
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 3 Dec 2015 10:34:10 +0000 (11:34 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 3 Dec 2015 12:24:48 +0000 (13:24 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index e344071..86c6886 100644 (file)
@@ -427,11 +427,10 @@ extern struct interfaceName * sgwTunnel6InterfaceNames;
  * @param fmtv the format for printing
  */
 static void sgw_ipvx(struct autobuf *abuf, bool ipv6) {
-  struct interfaceName * sgwTunnelInterfaceNames;
+  struct interfaceName * sgwTunnelInterfaceNames = !ipv6 ? sgwTunnel4InterfaceNames : sgwTunnel6InterfaceNames;
 
   abuf_json_mark_object(true, true, abuf, ipv6 ? "ipv6" : "ipv4");
 
-  sgwTunnelInterfaceNames = !ipv6 ? sgwTunnel4InterfaceNames : sgwTunnel6InterfaceNames;
   if (olsr_cnf->smart_gw_active && sgwTunnelInterfaceNames) {
     struct gateway_entry * current_gw = olsr_get_inet_gateway(ipv6);
     int i;