]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit()
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>
Tue, 22 Nov 2016 06:14:28 +0000 (14:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Nov 2016 01:18:36 +0000 (20:18 -0500)
For RT netlink, calcit() function should return the minimal size for
netlink dump message. This will make sure that dump message for every
network device can be stored.

Currently, rtnl_calcit() function doesn't account the size of header of
netlink message, this patch will fix it.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index a99917b5de337b97792635675cbc0cf3a6916442..deb35acbefd0012024e7b73679d26b48a973db8f 100644 (file)
@@ -2737,7 +2737,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
                                                           ext_filter_mask));
        }
 
-       return min_ifinfo_dump_size;
+       return nlmsg_total_size(min_ifinfo_dump_size);
 }
 
 static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)