diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2020-01-14 19:56:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-15 13:48:17 +0100 |
commit | 8f4cc940a149b9fe013a191d6d8dc87aee9a204f (patch) | |
tree | 0ddeb28db98f900befe91e0d56de5eb6b98f2274 /net/bridge/br_netlink.c | |
parent | 5a46facbbcd454985992b5109185329aebf82a02 (diff) | |
download | linux-riscv-8f4cc940a149b9fe013a191d6d8dc87aee9a204f.tar.gz linux-riscv-8f4cc940a149b9fe013a191d6d8dc87aee9a204f.tar.bz2 linux-riscv-8f4cc940a149b9fe013a191d6d8dc87aee9a204f.zip |
net: bridge: netlink: add extack error messages when processing vlans
Add extack messages on vlan processing errors. We need to move the flags
missing check after the "last" check since we may have "last" set but
lack a range end flag in the next entry.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r-- | net/bridge/br_netlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 14100e8653e6..40942cece51a 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -568,11 +568,11 @@ static int br_process_vlan_info(struct net_bridge *br, bool *changed, struct netlink_ext_ack *extack) { - if (!br_vlan_valid_id(vinfo_curr->vid)) + if (!br_vlan_valid_id(vinfo_curr->vid, extack)) return -EINVAL; if (vinfo_curr->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) { - if (!br_vlan_valid_range(vinfo_curr, *vinfo_last)) + if (!br_vlan_valid_range(vinfo_curr, *vinfo_last, extack)) return -EINVAL; *vinfo_last = vinfo_curr; return 0; @@ -582,7 +582,7 @@ static int br_process_vlan_info(struct net_bridge *br, struct bridge_vlan_info tmp_vinfo; int v, err; - if (!br_vlan_valid_range(vinfo_curr, *vinfo_last)) + if (!br_vlan_valid_range(vinfo_curr, *vinfo_last, extack)) return -EINVAL; memcpy(&tmp_vinfo, *vinfo_last, |