diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2015-01-28 19:23:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-29 01:21:31 -0500 |
commit | 59ccaaaa49b5b096cdc1f16706a9f931416b2332 (patch) | |
tree | 764a66a697481a65f8d16ab7277dede72642b187 /net/core | |
parent | 95224ac1801cbfadc2c587be15fded69a13c4e3b (diff) |
bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify
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: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 9cf6fe9ddc0c..446cbaf81185 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2895,12 +2895,16 @@ static int rtnl_bridge_notify(struct net_device *dev, u16 flags) | |||
2895 | goto errout; | 2895 | goto errout; |
2896 | } | 2896 | } |
2897 | 2897 | ||
2898 | if (!skb->len) | ||
2899 | goto errout; | ||
2900 | |||
2898 | rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); | 2901 | rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); |
2899 | return 0; | 2902 | return 0; |
2900 | errout: | 2903 | errout: |
2901 | WARN_ON(err == -EMSGSIZE); | 2904 | WARN_ON(err == -EMSGSIZE); |
2902 | kfree_skb(skb); | 2905 | kfree_skb(skb); |
2903 | rtnl_set_sk_err(net, RTNLGRP_LINK, err); | 2906 | if (err) |
2907 | rtnl_set_sk_err(net, RTNLGRP_LINK, err); | ||
2904 | return err; | 2908 | return err; |
2905 | } | 2909 | } |
2906 | 2910 | ||