Skip to content

Commit eaede83

Browse files
zhangjiarandavem330
authored andcommitted
net: hns3: use ipv6_addr_any() helper
Use common ipv6_addr_any() to determine if an addr is ipv6 any addr. Signed-off-by: Jiaran Zhang <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c318af3 commit eaede83

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/platform_device.h>
1414
#include <linux/if_vlan.h>
1515
#include <linux/crash_dump.h>
16+
#include <net/ipv6.h>
1617
#include <net/rtnetlink.h>
1718
#include "hclge_cmd.h"
1819
#include "hclge_dcb.h"
@@ -5508,12 +5509,10 @@ static int hclge_fd_check_tcpip6_tuple(struct ethtool_tcpip6_spec *spec,
55085509
BIT(INNER_IP_TOS);
55095510

55105511
/* check whether src/dst ip address used */
5511-
if (!spec->ip6src[0] && !spec->ip6src[1] &&
5512-
!spec->ip6src[2] && !spec->ip6src[3])
5512+
if (ipv6_addr_any((struct in6_addr *)spec->ip6src))
55135513
*unused_tuple |= BIT(INNER_SRC_IP);
55145514

5515-
if (!spec->ip6dst[0] && !spec->ip6dst[1] &&
5516-
!spec->ip6dst[2] && !spec->ip6dst[3])
5515+
if (ipv6_addr_any((struct in6_addr *)spec->ip6dst))
55175516
*unused_tuple |= BIT(INNER_DST_IP);
55185517

55195518
if (!spec->psrc)
@@ -5538,12 +5537,10 @@ static int hclge_fd_check_ip6_tuple(struct ethtool_usrip6_spec *spec,
55385537
BIT(INNER_IP_TOS) | BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
55395538

55405539
/* check whether src/dst ip address used */
5541-
if (!spec->ip6src[0] && !spec->ip6src[1] &&
5542-
!spec->ip6src[2] && !spec->ip6src[3])
5540+
if (ipv6_addr_any((struct in6_addr *)spec->ip6src))
55435541
*unused_tuple |= BIT(INNER_SRC_IP);
55445542

5545-
if (!spec->ip6dst[0] && !spec->ip6dst[1] &&
5546-
!spec->ip6dst[2] && !spec->ip6dst[3])
5543+
if (ipv6_addr_any((struct in6_addr *)spec->ip6dst))
55475544
*unused_tuple |= BIT(INNER_DST_IP);
55485545

55495546
if (!spec->l4_proto)

0 commit comments

Comments
 (0)