Commit eaede835 authored by Jiaran Zhang's avatar Jiaran Zhang Committed by David S. Miller

net: hns3: use ipv6_addr_any() helper

Use common ipv6_addr_any() to determine if an addr is ipv6 any addr.
Signed-off-by: default avatarJiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c318af3f
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/crash_dump.h> #include <linux/crash_dump.h>
#include <net/ipv6.h>
#include <net/rtnetlink.h> #include <net/rtnetlink.h>
#include "hclge_cmd.h" #include "hclge_cmd.h"
#include "hclge_dcb.h" #include "hclge_dcb.h"
...@@ -5508,12 +5509,10 @@ static int hclge_fd_check_tcpip6_tuple(struct ethtool_tcpip6_spec *spec, ...@@ -5508,12 +5509,10 @@ static int hclge_fd_check_tcpip6_tuple(struct ethtool_tcpip6_spec *spec,
BIT(INNER_IP_TOS); BIT(INNER_IP_TOS);
/* check whether src/dst ip address used */ /* check whether src/dst ip address used */
if (!spec->ip6src[0] && !spec->ip6src[1] && if (ipv6_addr_any((struct in6_addr *)spec->ip6src))
!spec->ip6src[2] && !spec->ip6src[3])
*unused_tuple |= BIT(INNER_SRC_IP); *unused_tuple |= BIT(INNER_SRC_IP);
if (!spec->ip6dst[0] && !spec->ip6dst[1] && if (ipv6_addr_any((struct in6_addr *)spec->ip6dst))
!spec->ip6dst[2] && !spec->ip6dst[3])
*unused_tuple |= BIT(INNER_DST_IP); *unused_tuple |= BIT(INNER_DST_IP);
if (!spec->psrc) if (!spec->psrc)
...@@ -5538,12 +5537,10 @@ static int hclge_fd_check_ip6_tuple(struct ethtool_usrip6_spec *spec, ...@@ -5538,12 +5537,10 @@ static int hclge_fd_check_ip6_tuple(struct ethtool_usrip6_spec *spec,
BIT(INNER_IP_TOS) | BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT); BIT(INNER_IP_TOS) | BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
/* check whether src/dst ip address used */ /* check whether src/dst ip address used */
if (!spec->ip6src[0] && !spec->ip6src[1] && if (ipv6_addr_any((struct in6_addr *)spec->ip6src))
!spec->ip6src[2] && !spec->ip6src[3])
*unused_tuple |= BIT(INNER_SRC_IP); *unused_tuple |= BIT(INNER_SRC_IP);
if (!spec->ip6dst[0] && !spec->ip6dst[1] && if (ipv6_addr_any((struct in6_addr *)spec->ip6dst))
!spec->ip6dst[2] && !spec->ip6dst[3])
*unused_tuple |= BIT(INNER_DST_IP); *unused_tuple |= BIT(INNER_DST_IP);
if (!spec->l4_proto) if (!spec->l4_proto)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment