|
27 | 27 | #include <linux/net.h> |
28 | 28 | #include <linux/pm_runtime.h> |
29 | 29 | #include <net/devlink.h> |
| 30 | +#include <net/ipv6.h> |
30 | 31 | #include <net/xdp_sock_drv.h> |
31 | 32 | #include <net/flow_offload.h> |
32 | 33 | #include <linux/ethtool_netlink.h> |
@@ -3127,7 +3128,6 @@ struct ethtool_rx_flow_rule * |
3127 | 3128 | ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input) |
3128 | 3129 | { |
3129 | 3130 | const struct ethtool_rx_flow_spec *fs = input->fs; |
3130 | | - static struct in6_addr zero_addr = {}; |
3131 | 3131 | struct ethtool_rx_flow_match *match; |
3132 | 3132 | struct ethtool_rx_flow_rule *flow; |
3133 | 3133 | struct flow_action_entry *act; |
@@ -3233,20 +3233,20 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input) |
3233 | 3233 |
|
3234 | 3234 | v6_spec = &fs->h_u.tcp_ip6_spec; |
3235 | 3235 | v6_m_spec = &fs->m_u.tcp_ip6_spec; |
3236 | | - if (memcmp(v6_m_spec->ip6src, &zero_addr, sizeof(zero_addr))) { |
| 3236 | + if (!ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6src)) { |
3237 | 3237 | memcpy(&match->key.ipv6.src, v6_spec->ip6src, |
3238 | 3238 | sizeof(match->key.ipv6.src)); |
3239 | 3239 | memcpy(&match->mask.ipv6.src, v6_m_spec->ip6src, |
3240 | 3240 | sizeof(match->mask.ipv6.src)); |
3241 | 3241 | } |
3242 | | - if (memcmp(v6_m_spec->ip6dst, &zero_addr, sizeof(zero_addr))) { |
| 3242 | + if (!ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6dst)) { |
3243 | 3243 | memcpy(&match->key.ipv6.dst, v6_spec->ip6dst, |
3244 | 3244 | sizeof(match->key.ipv6.dst)); |
3245 | 3245 | memcpy(&match->mask.ipv6.dst, v6_m_spec->ip6dst, |
3246 | 3246 | sizeof(match->mask.ipv6.dst)); |
3247 | 3247 | } |
3248 | | - if (memcmp(v6_m_spec->ip6src, &zero_addr, sizeof(zero_addr)) || |
3249 | | - memcmp(v6_m_spec->ip6dst, &zero_addr, sizeof(zero_addr))) { |
| 3248 | + if (!ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6src) || |
| 3249 | + !ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6dst)) { |
3250 | 3250 | match->dissector.used_keys |= |
3251 | 3251 | BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS); |
3252 | 3252 | match->dissector.offset[FLOW_DISSECTOR_KEY_IPV6_ADDRS] = |
|
0 commit comments