Browse Source

gluon-batman-adv-core: respondd: add gateway_nexthop field

Thomas Weißschuh 8 years ago
parent
commit
0a936e4de5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      package/gluon-mesh-batman-adv-core/src/respondd.c

+ 3 - 1
package/gluon-mesh-batman-adv-core/src/respondd.c

@@ -212,11 +212,13 @@ static void add_gateway(struct json_object *obj) {
 
 	while (getline(&line, &len, f) >= 0) {
 		char addr[18];
+		char nexthop[18];
 
-		if (sscanf(line, "=> %17[0-9a-fA-F:]", addr) != 1)
+		if (sscanf(line, "=> %17[0-9a-fA-F:] ( %*u) %17[0-9a-fA-F:]", addr, nexthop) != 2)
 			continue;
 
 		json_object_object_add(obj, "gateway", json_object_new_string(addr));
+		json_object_object_add(obj, "gateway_nexthop", json_object_new_string(nexthop));
 		break;
 	}