From: Sabrina Dubroca Date: Fri, 18 Nov 2016 14:50:39 +0000 (+0100) Subject: rtnetlink: fix FDB size computation X-Git-Tag: v4.8.14~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f8b251a09859816e52a21b3f77eeb0dc579cd1a;p=thirdparty%2Fkernel%2Fstable.git rtnetlink: fix FDB size computation [ Upstream commit f82ef3e10a870acc19fa04f80ef5877eaa26f41e ] Add missing NDA_VLAN attribute's size. Fixes: 1e53d5bb8878 ("net: Pass VLAN ID to rtnl_fdb_notify.") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 189cc78c77eba..9b39088e9077c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2791,7 +2791,10 @@ nla_put_failure: static inline size_t rtnl_fdb_nlmsg_size(void) { - return NLMSG_ALIGN(sizeof(struct ndmsg)) + nla_total_size(ETH_ALEN); + return NLMSG_ALIGN(sizeof(struct ndmsg)) + + nla_total_size(ETH_ALEN) + /* NDA_LLADDR */ + nla_total_size(sizeof(u16)) + /* NDA_VLAN */ + 0; } static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,