From 659aafaec8d8f1b8f4cf9a955b65420942abbea5 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Thu, 12 Apr 2012 04:52:26 -0400 Subject: [PATCH] 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. --- ndhc/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndhc/netlink.c b/ndhc/netlink.c index 985b783..b5520f7 100644 --- a/ndhc/netlink.c +++ b/ndhc/netlink.c @@ -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);