From 6460346bb68125de7e4aceccc717665e63d03667 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 17 Mar 2014 06:14:14 -0400 Subject: [PATCH] Fix the NLMSG_LENGTH() arguments in nl.c. Somehow it worked before by lucky coincidence, but the types provided to the sizeof were wrong. --- ndhc/nl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndhc/nl.c b/ndhc/nl.c index 1e15190..1b277a8 100644 --- a/ndhc/nl.c +++ b/ndhc/nl.c @@ -172,7 +172,7 @@ static int nl_sendgetlink_do(int fd, int seq, int ifindex, int by_ifindex) ssize_t r; memset(nlbuf, 0, sizeof nlbuf); - nlh->nlmsg_len = NLMSG_LENGTH(sizeof (struct rtattr)); + nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); nlh->nlmsg_type = RTM_GETLINK; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; nlh->nlmsg_seq = seq; @@ -218,7 +218,7 @@ int nl_sendgetaddr(int fd, int seq, int ifindex) ssize_t r; memset(nlbuf, 0, sizeof nlbuf); - nlh->nlmsg_len = NLMSG_LENGTH(sizeof (struct rtattr)); + nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); nlh->nlmsg_type = RTM_GETADDR; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; nlh->nlmsg_seq = seq;