jsoninfo: sgw: minor simplification reducing memory usage
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 24 Nov 2015 07:57:43 +0000 (08:57 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 24 Nov 2015 07:57:58 +0000 (08:57 +0100)
tunnelGw is the same as originator

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

index 04514b2..150dfe3 100644 (file)
@@ -875,8 +875,6 @@ static void sgw_ipvx(struct autobuf *abuf, bool ipv6) {
         const char * originator = olsr_ip_to_string(&originatorStr, &gw->originator);
         struct ipaddr_str prefixIpStr;
         const char * prefix = olsr_ip_to_string(&prefixIpStr, &gw->external_prefix.prefix);
-        struct ipaddr_str tunnelGwStr;
-        const char * tunnelGw = olsr_ip_to_string(&tunnelGwStr, &gw->originator);
 
         abuf_json_boolean(abuf, "selected", current_gw && (current_gw == gw));
         abuf_json_string(abuf, "originator", originator);
@@ -889,7 +887,7 @@ static void sgw_ipvx(struct autobuf *abuf, bool ipv6) {
         abuf_json_boolean(abuf, "IPv4-NAT", gw->ipv4nat);
         abuf_json_boolean(abuf, "IPv6", gw->ipv6);
         abuf_json_string(abuf, "tunnel", node->name);
-        abuf_json_string(abuf, "destination", tunnelGw);
+        abuf_json_string(abuf, "destination", originator);
         abuf_json_int(abuf, "cost", gw->path_cost);
         abuf_json_int(abuf, "tableNr", node->tableNr);
         abuf_json_int(abuf, "ruleNr", node->ruleNr);