summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2021-06-09 14:17:53 +0300
committerSasha Levin <sashal@kernel.org>2021-06-30 08:48:49 -0400
commit88cfd542f4390f992f47ab876accb2ab789e4056 (patch)
tree20d5c29f73e8eedaac3068981c95684379ff6a97 /net
parenta0882f68f54f7a8b6308261acee9bd4faab5a69e (diff)
downloadlinux-stable-88cfd542f4390f992f47ab876accb2ab789e4056.tar.gz
linux-stable-88cfd542f4390f992f47ab876accb2ab789e4056.tar.bz2
linux-stable-88cfd542f4390f992f47ab876accb2ab789e4056.zip
rtnetlink: Fix regression in bridge VLAN configuration
[ Upstream commit d2e381c4963663bca6f30c3b996fa4dbafe8fcb5 ] Cited commit started returning errors when notification info is not filled by the bridge driver, resulting in the following regression: # ip link add name br1 type bridge vlan_filtering 1 # bridge vlan add dev br1 vid 555 self pvid untagged RTNETLINK answers: Invalid argument As long as the bridge driver does not fill notification info for the bridge device itself, an empty notification should not be considered as an error. This is explained in commit 59ccaaaa49b5 ("bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify"). Fix by removing the error and add a comment to avoid future bugs. Fixes: a8db57c1d285 ("rtnetlink: Fix missing error code in rtnl_bridge_notify()") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Nikolay Aleksandrov <nikolay@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/rtnetlink.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index fa3ed51f846b..3bcaecc7ba69 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3648,10 +3648,12 @@ static int rtnl_bridge_notify(struct net_device *dev)
if (err < 0)
goto errout;
- if (!skb->len) {
- err = -EINVAL;
+ /* Notification info is only filled for bridge ports, not the bridge
+ * device itself. Therefore, a zero notification length is valid and
+ * should not result in an error.
+ */
+ if (!skb->len)
goto errout;
- }
rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
return 0;