]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: bridge: vlan: fix single net device option dumping
authorNikolay Aleksandrov <nikolay@nvidia.com>
Wed, 26 Jan 2022 13:10:25 +0000 (15:10 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:54 +0000 (10:28 +0100)
commitd740a095d7611f5d7e7fa66ffc60f0c1437b4a7e
tree2c1bbf51f45e92f9b7867b7fb5c4b52867250bf2
parentd1801724e67684ef6936baf5557fed12f6bbf4eb
net: bridge: vlan: fix single net device option dumping

BugLink: https://bugs.launchpad.net/bugs/1959879
[ Upstream commit dcb2c5c6ca9b9177f04abaf76e5a983d177c9414 ]

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 <bpoirier@nvidia.com>
Fixes: 8dcea187088b ("net: bridge: vlan: add rtm definitions and dump support")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/bridge/br_vlan.c