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:02 -0500 |
commit | 520f851564ab18b43ffd027ccf875558ba3727cf (patch) | |
tree | bde0e94491d3a880aec2637174fd01076f0bde46 | |
parent | 5ea86c98fc2729e78cb6b8ce7b1d3981133a6145 (diff) | |
download | iwd-520f851564ab18b43ffd027ccf875558ba3727cf.tar.gz |
netconfig: Use the global rtnl object
-rw-r--r-- | src/netconfig.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/netconfig.c b/src/netconfig.c index b0fee4977..1e6af3d26 100644 --- a/src/netconfig.c +++ b/src/netconfig.c @@ -1215,14 +1215,7 @@ static int netconfig_init(void) return 0; } - rtnl = l_netlink_new(NETLINK_ROUTE); - if (!rtnl) { - l_error("netconfig: Failed to open route netlink socket"); - return -EPERM; - } - - if (getenv("IWD_RTNL_DEBUG")) - l_netlink_set_debug(rtnl, do_debug, "[NETCONFIG RTNL] ", NULL); + rtnl = iwd_get_rtnl(); r = l_netlink_register(rtnl, RTNLGRP_IPV4_IFADDR, netconfig_ifaddr_notify, NULL, NULL); @@ -1264,7 +1257,6 @@ static int netconfig_init(void) return 0; error: - l_netlink_destroy(rtnl); rtnl = NULL; return r; @@ -1275,7 +1267,6 @@ static void netconfig_exit(void) if (!netconfig_list) return; - l_netlink_destroy(rtnl); rtnl = NULL; l_queue_destroy(netconfig_list, netconfig_free); |