Commit efa4b71b authored by Roopa Prabhu's avatar Roopa Prabhu Committed by Jiri Slaby

bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify

[ Upstream commit 59ccaaaa ]

Reported in: https://bugzilla.kernel.org/show_bug.cgi?id=92081

This patch avoids calling rtnl_notify if the device ndo_bridge_getlink
handler does not return any bytes in the skb.

Alternately, the skb->len check can be moved inside rtnl_notify.

For the bridge vlan case described in 92081, there is also a fix needed
in bridge driver to generate a proper notification. Will fix that in
subsequent patch.

v2: rebase patch on net tree
Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent d7a5ebfe
......@@ -2542,11 +2542,15 @@ static int rtnl_bridge_notify(struct net_device *dev, u16 flags)
goto errout;
}
if (!skb->len)
goto errout;
rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
return 0;
errout:
WARN_ON(err == -EMSGSIZE);
kfree_skb(skb);
if (err)
rtnl_set_sk_err(net, RTNLGRP_LINK, err);
return err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment