Commit 2c53f334 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Zheng Zengkai
Browse files

net: bridge: vlan: fix single net device option dumping

stable inclusion
from stable-v5.10.96
commit 9ffc94a81b0f2b7db78a630b5ae1032a551619d6
bugzilla: https://gitee.com/openeuler/kernel/issues/I55NWB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9ffc94a81b0f2b7db78a630b5ae1032a551619d6



--------------------------------

[ Upstream commit dcb2c5c6 ]

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: default avatarBenjamin Poirier <bpoirier@nvidia.com>
Fixes: 8dcea187 ("net: bridge: vlan: add rtm definitions and dump support")
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 20b04c64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment