Copy & paste is not allways the right way. The previous patch for netlink.c what not OK. The right patch is: diff --git a/netlink.c b/netlink.c index 1b5695c..445161d 100644 --- a/netlink.c +++ b/netlink.c @@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const struct ether_addr *mac, return 0; } + +int batadv_interface_check_netlink(const char *mesh_iface) +{ + struct get_tq_netlink_opts opts = { + .tq = 0, + .found = false, + .query_opts = { + .err = 0, + }, + }; + int ret = 0; + + memset(&opts.mac, 0, ETH_ALEN); + + ret = netlink_query_common(mesh_iface, BATADV_CMD_GET_ORIGINATORS, + get_tq_netlink_cb, &opts.query_opts); + if (ret < 0) + return ret; + + memset(&opts.mac, 0, ETH_ALEN); + ret = netlink_query_common(mesh_iface, BATADV_CMD_GET_TRANSTABLE_GLOBAL, + get_tq_netlink_cb, &opts.query_opts); + + if (ret < 0) + return ret; + return 0; +}