From 0145c1ef7f993f7ab1fffa3373dac67474336184 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Tue, 26 Feb 2019 20:02:58 +0100 Subject: [PATCH] gluon-mesh-batman-adv: Save if metrics chose neighbor as own best nexthop The commit ee63ed42fe6c ("gluon-mesh-batman-adv: List neighbors with non-best direct link") removed the check whether a neighbor has the BATADV_ATTR_FLAG_BEST set. But consumers may still want to filter out or mark neighbors which don't have this flag set. To assist with such a feature, enhance the neighbor object with an extra boolean "best" attribute which stores whether the BATADV_ATTR_FLAG_BEST was found or not. Reported-by: Vincent Wiemann --- package/gluon-mesh-batman-adv/src/respondd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-mesh-batman-adv/src/respondd.c b/package/gluon-mesh-batman-adv/src/respondd.c index 6f9f6730..a07e6a14 100644 --- a/package/gluon-mesh-batman-adv/src/respondd.c +++ b/package/gluon-mesh-batman-adv/src/respondd.c @@ -695,6 +695,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) json_object_object_add(obj, "tq", json_object_new_int(tq)); json_object_object_add(obj, "lastseen", json_object_new_double(lastseen / 1000.)); + json_object_object_add(obj, "best", json_object_new_boolean(attrs[BATADV_ATTR_FLAG_BEST])); json_object_object_add(interface, mac1, obj); return NL_OK;