]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Jan 2022 13:48:17 +0000 (13:48 +0000)
commitc252ab99b5f823495aebb93ebba737420c6a5458
treedbfe0b9499abc8c0f658ee1c92dbf4d9dd89de6f
parent90e4cef2f9e2cc6be3fb61c5430d773b8b4cabbd
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 <bpoirier@nvidia.com>
Fixes: 268e4fb623ce ("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>
net/bridge/br_vlan.c