eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 1b08602727a0d622fe6006a6141df1fea3e35cd7
parent d85e6eedff2388fe59fb95988c5e6cc868217bf6
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Tue, 16 Apr 2019 16:18:59 -0500

manager: Make sure to not leak msg on failure:wq

Diffstat:
Msrc/manager.c | 28++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/manager.c b/src/manager.c @@ -575,17 +575,10 @@ static void manager_wiphy_dump_callback(struct l_genl_msg *msg, void *user_data) bool manager_init(struct l_genl_family *in, const char *if_whitelist, const char *if_blacklist) { - nl80211 = in; - - if (!l_genl_family_register(nl80211, "config", manager_config_notify, - NULL, NULL)) - l_error("Registering for config notifications failed"); + struct l_genl_msg *msg; + unsigned int id; - if (!l_genl_family_dump(nl80211, - l_genl_msg_new(NL80211_CMD_GET_WIPHY), - manager_wiphy_dump_callback, - NULL, NULL)) - l_error("Initial wiphy information dump failed"); + nl80211 = in; if (if_whitelist) whitelist_filter = l_strsplit(if_whitelist, ','); @@ -595,6 +588,21 @@ bool manager_init(struct l_genl_family *in, pending_wiphys = l_queue_new(); + if (!l_genl_family_register(nl80211, "config", manager_config_notify, + NULL, NULL)) { + l_error("Registering for config notifications failed"); + return false; + } + + msg = l_genl_msg_new(NL80211_CMD_GET_WIPHY); + id = l_genl_family_dump(nl80211, msg, + manager_wiphy_dump_callback, NULL, NULL); + if (!id) { + l_error("Initial wiphy information dump failed"); + l_genl_msg_unref(msg); + return false; + } + return true; }