Skip to content

Commit

Permalink
rtnetlink: fix FDB size computation
Browse files Browse the repository at this point in the history
[ Upstream commit f82ef3e ]

Add missing NDA_VLAN attribute's size.

Fixes: 1e53d5b ("net: Pass VLAN ID to rtnl_fdb_notify.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
qsn authored and gregkh committed Dec 10, 2016
1 parent 6ef59b9 commit aece024
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,10 @@ static int nlmsg_populate_fdb_fill(struct sk_buff *skb,

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)
Expand Down

0 comments on commit aece024

Please sign in to comment.