gluon-mesh-batman-adv: Save if metrics chose neighbor as own best nexthop

The commit ee63ed42fe ("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 <webmaster@codefetch.de>
This commit is contained in:
Sven Eckelmann 2019-02-26 20:02:58 +01:00 committed by Andreas Ziegler
parent d0df47d943
commit cef21e584a

View File

@ -694,6 +694,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;