aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/priv_netlink.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-12 16:07:17 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-12 16:27:16 (GMT)
commit54a800dd518eea0251a4fb0b412680ad73195f68 (patch)
treee1a7b55ee5e0f93fe5d7682fd750cd815c57861a /src/drivers/priv_netlink.h
parenta6938b79b42cb99e010c41457db8b71331bd8ebb (diff)
downloadhostap-54a800dd518eea0251a4fb0b412680ad73195f68.zip
hostap-54a800dd518eea0251a4fb0b412680ad73195f68.tar.gz
hostap-54a800dd518eea0251a4fb0b412680ad73195f68.tar.bz2
netlink: Fix RTM_SETLINK padding at the end of the message
While the kernel seems to have accepted the message to set linkmode and operstate without the final attribute getting padded to 32-bit length, it is better to get this cleaned up to match expected format. The double NLMSG_ALIGN() followed by RTA_LENGTH() did not make much sense here. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/drivers/priv_netlink.h')
-rw-r--r--src/drivers/priv_netlink.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/priv_netlink.h b/src/drivers/priv_netlink.h
index 6232088..d3f091c 100644
--- a/src/drivers/priv_netlink.h
+++ b/src/drivers/priv_netlink.h
@@ -68,6 +68,7 @@
((attrlen) -= RTA_ALIGN((rta)->rta_len), \
(struct rtattr *) (((char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
#define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0)))
#define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0))