jsoninfo: also show the hops for /sgw, like for /gateways
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Feb 2016 13:09:43 +0000 (14:09 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Feb 2016 17:00:10 +0000 (18:00 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 993ee2d..e20e6bb 100644 (file)
@@ -468,6 +468,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_int(abuf, "cost", gw->path_cost);
+        abuf_json_int(abuf, "hops", !tc ? 0 : tc->hops);
         abuf_json_ip_address(abuf, "destination", &gw->originator);
         abuf_json_string(abuf, "tunnel", node->name);
         abuf_json_int(abuf, "tableNr", node->tableNr);