Skip to content

Commit dcb2c5c

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net: bridge: vlan: fix single net device option dumping
When dumping vlan options for a single net device we send the same entries infinitely because user-space expects a 0 return at the end but we keep returning skb->len and restarting the dump on retry. Fix it by returning the value from br_vlan_dump_dev() if it completed or there was an error. The only case that must return skb->len is when the dump was incomplete and needs to continue (-EMSGSIZE). Reported-by: Benjamin Poirier <[email protected]> Fixes: 8dcea18 ("net: bridge: vlan: add rtm definitions and dump support") Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aa44323 commit dcb2c5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bridge/br_vlan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,8 @@ static int br_vlan_rtm_dump(struct sk_buff *skb, struct netlink_callback *cb)
20202020
goto out_err;
20212021
}
20222022
err = br_vlan_dump_dev(dev, skb, cb, dump_flags);
2023-
if (err && err != -EMSGSIZE)
2023+
/* if the dump completed without an error we return 0 here */
2024+
if (err != -EMSGSIZE)
20242025
goto out_err;
20252026
} else {
20262027
for_each_netdev_rcu(net, dev) {

0 commit comments

Comments
 (0)