Skip to content

Commit

Permalink
Fix issue with introduction of batman TQ propery in respondd
Browse files Browse the repository at this point in the history
Gluon introduced adding the TQ property of batman to the gateway
information. As we do use BATMAN V, where a TQ property no longer
exists, gateway information was dropped completely from respondd content
and our status page.

This change fixes this, by using the THROUGHPUT propery instead.

Co-Authored-By: Steffen Förster <nemesis@chemnitz.freifunk.net>
Co-Authored-By: Malte Wedel <ich@malte.de>
  • Loading branch information
3 people committed Oct 31, 2024
1 parent 4b8a7cf commit bf59ed7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions package/gluon-mesh-batman-adv/src/respondd-statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct gw_netlink_opts {
static const enum batadv_nl_attrs gateways_mandatory[] = {
BATADV_ATTR_ORIG_ADDRESS,
BATADV_ATTR_ROUTER,
BATADV_ATTR_TQ,
BATADV_ATTR_THROUGHPUT,
};

static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
Expand All @@ -52,7 +52,7 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
struct genlmsghdr *ghdr;
uint8_t *orig;
uint8_t *router;
uint8_t tq;
uint32_t throughput;
struct gw_netlink_opts *opts;
char addr[18];

Expand Down Expand Up @@ -80,13 +80,13 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)

orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);
router = nla_data(attrs[BATADV_ATTR_ROUTER]);
tq = nla_get_u8(attrs[BATADV_ATTR_TQ]);
throughput = nla_get_u32(attrs[BATADV_ATTR_THROUGHPUT]);

sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x",
orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]);

json_object_object_add(opts->obj, "gateway", json_object_new_string(addr));
json_object_object_add(opts->obj, "gateway_tq", json_object_new_int(tq));
json_object_object_add(opts->obj, "gateway_throughput", json_object_new_int(throughput));

sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x",
router[0], router[1], router[2], router[3], router[4], router[5]);
Expand Down

0 comments on commit bf59ed7

Please sign in to comment.