diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2022-05-31 08:37:27 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-06-01 11:18:55 +0200 |
commit | c4caa500ffebf64795d1c0f6f9d6f179b502c6b7 (patch) | |
tree | f466365c2dc934f8bfb47cb009b88bf81364799e /drivers/net/bonding/bond_main.c | |
parent | tcp: tcp_rtx_synack() can be called from process context (diff) | |
download | linux-c4caa500ffebf64795d1c0f6f9d6f179b502c6b7.tar.xz linux-c4caa500ffebf64795d1c0f6f9d6f179b502c6b7.zip |
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: 4e24be018eb9 ("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>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3b7baaeae82c..f85372adf042 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -6159,7 +6159,9 @@ static int bond_check_params(struct bond_params *params) strscpy_pad(params->primary, primary, sizeof(params->primary)); memcpy(params->arp_targets, arp_target, sizeof(arp_target)); +#if IS_ENABLED(CONFIG_IPV6) memset(params->ns_targets, 0, sizeof(struct in6_addr) * BOND_MAX_NS_TARGETS); +#endif return 0; } |