Fix netlink payload length calculation

nlmsghdr length needs to be removed from payload length. [Bug 341]
This commit is contained in:
Jouni Malinen 2009-12-18 16:14:54 +02:00 committed by Jouni Malinen
parent 0e15e529eb
commit 3b31db5199
7 changed files with 13 additions and 10 deletions

View file

@ -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;