]> git.proxmox.com Git - mirror_iproute2.git/commit
libnetlink: Use NLMSG_LENGTH to set nlmsg_len
authorDavid Ahern <dsahern@gmail.com>
Fri, 19 Oct 2018 22:34:44 +0000 (15:34 -0700)
committerDavid Ahern <dsahern@gmail.com>
Thu, 27 Dec 2018 23:32:57 +0000 (15:32 -0800)
commit92e03242c4c0a5c6ac3571153dc7323b0b45a430
tree148ad0c7a91067eda20b6263d1882b0b08d5e025
parent2750252d7e850793a7d50987abb974141eb8525e
libnetlink: Use NLMSG_LENGTH to set nlmsg_len

Change nlmsg_len from sizeof(req) to use NLMSG_LENGTH on the header.
2 of the inner headers are not 4-byte aligned, so add a 0-length buf
after the header with the __aligned(NLMSG_ALIGNTO) to ensure the size
of the request is large enough. Use NLMSG_ALIGN in NLMSG_LENGTH to set
nlmsg_len.

Signed-off-by: David Ahern <dsahern@gmail.com>
lib/libnetlink.c