]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: netlink error message support for options
authorJonathan Toppins <jtoppins@redhat.com>
Wed, 8 Jun 2022 18:14:56 +0000 (14:14 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 06:02:54 +0000 (23:02 -0700)
commit7fa6c0145e9ca5d76665b897a47b6722cc42165d
treeeb7f6a197c8fc8a5a54750b6f6c022b39ef26b14
parentc2b2239368f3c1375fe8119c958f408260741628
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>
drivers/net/bonding/bond_netlink.c
drivers/net/bonding/bond_options.c
include/net/bond_options.h