diff options
author | Jonathan Toppins <jtoppins@redhat.com> | 2022-06-08 14:14:56 -0400 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-09 23:02:54 -0700 |
commit | 2bff369b23542ea22d0111aaa8e0b8208bf0dc96 (patch) | |
tree | eb7f6a197c8fc8a5a54750b6f6c022b39ef26b14 /include/net/bond_options.h | |
parent | ce1d8e74f779ed0a35becdc81c3f9b3fa9603b13 (diff) | |
download | lwn-2bff369b23542ea22d0111aaa8e0b8208bf0dc96.tar.gz lwn-2bff369b23542ea22d0111aaa8e0b8208bf0dc96.zip |
bonding: netlink error message support for options
Add support for reporting errors via extack in both bond_newlink
and bond_changelink.
Instead of having to look in the kernel log for why an option was not
correct just report the error to the user via the extack variable.
What is currently reported today:
ip link add bond0 type bond
ip link set bond0 up
ip link set bond0 type bond mode 4
RTNETLINK answers: Device or resource busy
After this change:
ip link add bond0 type bond
ip link set bond0 up
ip link set bond0 type bond mode 4
Error: unable to set option because the bond is up.
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/bond_options.h')
-rw-r--r-- | include/net/bond_options.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/bond_options.h b/include/net/bond_options.h index 61b49063791c..1618b76f4903 100644 --- a/include/net/bond_options.h +++ b/include/net/bond_options.h @@ -107,7 +107,8 @@ struct bond_option { }; int __bond_opt_set(struct bonding *bond, unsigned int option, - struct bond_opt_value *val); + struct bond_opt_value *val, + struct nlattr *bad_attr, struct netlink_ext_ack *extack); int __bond_opt_set_notify(struct bonding *bond, unsigned int option, struct bond_opt_value *val); int bond_opt_tryset_rtnl(struct bonding *bond, unsigned int option, char *buf); |