netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net] rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit()
@ 2016-11-22  6:14 Zhang Shengju
  2016-11-23 15:38 ` Roopa Prabhu
  2016-11-24  1:27 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Shengju @ 2016-11-22  6:14 UTC (permalink / raw)
  To: netdev, davem; +Cc: roopa

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>
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index f4b9350..09e115b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2734,7 +2734,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)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-24  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22  6:14 [net] rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit() Zhang Shengju
2016-11-23 15:38 ` Roopa Prabhu
2016-11-24  1:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).