Silence new kernel warning introduced in 3.3: 'netlink: 12 bytes leftover

after parsing attributes.' RTM_GETLINK messages should have a struct rtattr
as payload.
This commit is contained in:
Nicholas J. Kain 2012-04-12 04:52:26 -04:00
parent a8a761da14
commit 659aafaec8

View File

@ -143,7 +143,7 @@ static int nl_sendgetlink(struct client_state_t *cs)
struct nlmsghdr *nlh = (struct nlmsghdr *)nlbuf;
memset(nlbuf, 0, sizeof nlbuf);
nlh->nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
nlh->nlmsg_len = NLMSG_LENGTH(sizeof (struct rtattr));
nlh->nlmsg_type = RTM_GETLINK;
nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
nlh->nlmsg_seq = time(NULL);