aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_wext.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-12-18 14:14:54 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-18 14:14:54 (GMT)
commit3b31db5199dba0b3749d92ca4fe6633694711fa8 (patch)
tree66494d74c0467a589e41232e399258bd066b4c4b /src/drivers/driver_wext.c
parent0e15e529eb201478954c7104ebb22edb7fb4359b (diff)
downloadhostap-3b31db5199dba0b3749d92ca4fe6633694711fa8.zip
hostap-3b31db5199dba0b3749d92ca4fe6633694711fa8.tar.gz
hostap-3b31db5199dba0b3749d92ca4fe6633694711fa8.tar.bz2
Fix netlink payload length calculation
nlmsghdr length needs to be removed from payload length. [Bug 341]
Diffstat (limited to 'src/drivers/driver_wext.c')
-rw-r--r--src/drivers/driver_wext.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 9d6a48d..e3652d9 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -637,7 +637,7 @@ static int wpa_driver_wext_own_ifname(struct wpa_driver_wext_data *drv,
nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg));
- attrlen = h->nlmsg_len - nlmsg_len;
+ attrlen = NLMSG_PAYLOAD(h, sizeof(struct ifinfomsg));
if (attrlen < 0)
return 0;
@@ -716,7 +716,7 @@ static void wpa_driver_wext_event_rtm_newlink(struct wpa_driver_wext_data *drv,
nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg));
- attrlen = h->nlmsg_len - nlmsg_len;
+ attrlen = NLMSG_PAYLOAD(h, sizeof(struct ifinfomsg));
if (attrlen < 0)
return;
@@ -753,7 +753,7 @@ static void wpa_driver_wext_event_rtm_dellink(struct wpa_driver_wext_data *drv,
nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg));
- attrlen = h->nlmsg_len - nlmsg_len;
+ attrlen = NLMSG_PAYLOAD(h, sizeof(struct ifinfomsg));
if (attrlen < 0)
return;