diff options
author | Denis Kenzior <denkenz@gmail.com> | 2020-04-08 12:28:00 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2020-04-08 12:35:04 -0500 |
commit | 6c959336639e2f6464c4a489b1025d776de58baf (patch) | |
tree | 5249c2774cd03ccdecb8b0c52b8c8fea4f762250 | |
parent | 520f851564ab18b43ffd027ccf875558ba3727cf (diff) | |
download | iwd-6c959336639e2f6464c4a489b1025d776de58baf.tar.gz |
netdev: Use the global rtnl object
-rw-r--r-- | src/netdev.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/netdev.c b/src/netdev.c index f999a14c0..32c76b17c 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -168,13 +168,6 @@ static struct watchlist netdev_watches; static bool pae_over_nl80211; static bool mac_per_ssid; -static void do_debug(const char *str, void *user_data) -{ - const char *prefix = user_data; - - l_info("%s%s", prefix, str); -} - /* Cancels ongoing GTK/IGTK related commands (if any) */ static void netdev_handshake_state_cancel_rekey( struct netdev_handshake_state *nhs) @@ -4723,16 +4716,7 @@ static int netdev_init(void) if (rtnl) return -EALREADY; - l_debug("Opening route netlink socket"); - - rtnl = l_netlink_new(NETLINK_ROUTE); - if (!rtnl) { - l_error("Failed to open route netlink socket"); - return -EIO; - } - - if (getenv("IWD_RTNL_DEBUG")) - l_netlink_set_debug(rtnl, do_debug, "[RTNL] ", NULL); + rtnl = iwd_get_rtnl(); if (!l_netlink_register(rtnl, RTNLGRP_LINK, netdev_link_notify, NULL, NULL)) { @@ -4782,7 +4766,6 @@ static int netdev_init(void) return 0; fail_netlink: - l_netlink_destroy(rtnl); rtnl = NULL; return -EIO; @@ -4802,8 +4785,6 @@ static void netdev_exit(void) l_genl_family_free(nl80211); nl80211 = NULL; - l_debug("Closing route netlink socket"); - l_netlink_destroy(rtnl); rtnl = NULL; } |