diff --git a/src/drivers/netlink.c b/src/drivers/netlink.c index dd662f371..6c60550fd 100644 --- a/src/drivers/netlink.c +++ b/src/drivers/netlink.c @@ -97,8 +97,6 @@ struct netlink_data * netlink_init(struct netlink_config *cfg) if (netlink == NULL) return NULL; - netlink->cfg = cfg; - netlink->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (netlink->sock < 0) { wpa_printf(MSG_ERROR, "netlink: Failed to open netlink " @@ -121,6 +119,8 @@ struct netlink_data * netlink_init(struct netlink_config *cfg) eloop_register_read_sock(netlink->sock, netlink_receive, netlink, NULL); + netlink->cfg = cfg; + return netlink; }