]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: guard ns_targets by CONFIG_IPV6
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 31 May 2022 06:37:27 +0000 (14:37 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 1 Jun 2022 09:18:55 +0000 (11:18 +0200)
commitf3aa5ae66a971e499c8052a5f01041a87b259d10
treef466365c2dc934f8bfb47cb009b88bf81364799e
parent49fcad7fb3b9a0d51412ed8ebc20ae864beaecdd
bonding: guard ns_targets by CONFIG_IPV6

Guard ns_targets in struct bond_params by CONFIG_IPV6, which could save
256 bytes if IPv6 not configed. Also add this protection for function
bond_is_ip6_target_ok() and bond_get_targets_ip6().

Remove the IS_ENABLED() check for bond_opts[] as this will make
BOND_OPT_NS_TARGETS uninitialized if CONFIG_IPV6 not enabled. Add
a dummy bond_option_ns_ip6_targets_set() for this situation.

Fixes: 56219e7c688b ("bonding: add new parameter ns_targets")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Jonathan Toppins <jtoppins@redhat.com>
Link: https://lore.kernel.org/r/20220531063727.224043-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_options.c
include/net/bonding.h