diff options
Diffstat (limited to 'src/drivers/netlink.c')
| -rw-r--r-- | src/drivers/netlink.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/drivers/netlink.c b/src/drivers/netlink.c index ad15b1d62a8d..6c60550fd613 100644 --- a/src/drivers/netlink.c +++ b/src/drivers/netlink.c @@ -2,14 +2,8 @@ * Netlink helper functions for driver wrappers * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi> * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. + * This software may be distributed under the terms of the BSD license. + * See README for more details. */ #include "includes.h" @@ -34,7 +28,7 @@ static void netlink_receive_link(struct netlink_data *netlink, if (cb == NULL || NLMSG_PAYLOAD(h, 0) < sizeof(struct ifinfomsg)) return; cb(netlink->cfg->ctx, NLMSG_DATA(h), - NLMSG_DATA(h) + NLMSG_ALIGN(sizeof(struct ifinfomsg)), + (u8 *) NLMSG_DATA(h) + NLMSG_ALIGN(sizeof(struct ifinfomsg)), NLMSG_PAYLOAD(h, sizeof(struct ifinfomsg))); } @@ -103,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 " @@ -127,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; } |
