From 0a936e4de533d8fc2332a0292cad3a1cdff3e345 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Thu, 2 Jun 2016 14:14:13 +0000
Subject: [PATCH] gluon-batman-adv-core: respondd: add gateway_nexthop field

---
 package/gluon-mesh-batman-adv-core/src/respondd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c
index 7c2ac6c77..f21eb62eb 100644
--- a/package/gluon-mesh-batman-adv-core/src/respondd.c
+++ b/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;
 	}
 
-- 
GitLab