mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
netconfig: Use the global rtnl object
This commit is contained in:
parent
5ea86c98fc
commit
520f851564
@ -1215,14 +1215,7 @@ static int netconfig_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtnl = l_netlink_new(NETLINK_ROUTE);
|
rtnl = iwd_get_rtnl();
|
||||||
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);
|
|
||||||
|
|
||||||
r = l_netlink_register(rtnl, RTNLGRP_IPV4_IFADDR,
|
r = l_netlink_register(rtnl, RTNLGRP_IPV4_IFADDR,
|
||||||
netconfig_ifaddr_notify, NULL, NULL);
|
netconfig_ifaddr_notify, NULL, NULL);
|
||||||
@ -1264,7 +1257,6 @@ static int netconfig_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
l_netlink_destroy(rtnl);
|
|
||||||
rtnl = NULL;
|
rtnl = NULL;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
@ -1275,7 +1267,6 @@ static void netconfig_exit(void)
|
|||||||
if (!netconfig_list)
|
if (!netconfig_list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
l_netlink_destroy(rtnl);
|
|
||||||
rtnl = NULL;
|
rtnl = NULL;
|
||||||
|
|
||||||
l_queue_destroy(netconfig_list, netconfig_free);
|
l_queue_destroy(netconfig_list, netconfig_free);
|
||||||
|
Loading…
Reference in New Issue
Block a user