]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: vlan: fix nlmsg size calculation in vlan_get_size()
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 7 Oct 2013 21:19:58 +0000 (23:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 May 2014 05:53:34 +0000 (07:53 +0200)
[ Upstream commit c33a39c575068c2ea9bffb22fd6de2df19c74b89 ]

This patch fixes the calculation of the nlmsg size, by adding the missing
nla_total_size().

Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/8021q/vlan_netlink.c

index a91504850195ff91ef178a390492fd50375e25c3..1f13bcf487b067528fa2d665add6890dfcb5a8e7 100644 (file)
@@ -169,7 +169,7 @@ static size_t vlan_get_size(const struct net_device *dev)
        struct vlan_dev_info *vlan = vlan_dev_info(dev);
 
        return nla_total_size(2) +      /* IFLA_VLAN_ID */
-              sizeof(struct ifla_vlan_flags) + /* IFLA_VLAN_FLAGS */
+              nla_total_size(sizeof(struct ifla_vlan_flags)) + /* IFLA_VLAN_FLAGS */
               vlan_qos_map_size(vlan->nr_ingress_mappings) +
               vlan_qos_map_size(vlan->nr_egress_mappings);
 }