]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()
authorGuangbin Huang <huangguangbin2@huawei.com>
Fri, 14 Feb 2020 01:53:43 +0000 (09:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Feb 2020 15:05:17 +0000 (07:05 -0800)
commitea1e9fdf487c4fb45fd65d8b6e4c051d7f92d238
tree07d8161cc6dfd3952b4f0b643898a9641afac123
parent02bfcbe4bf96bcc5d949bcad03e86b090d40c5d0
net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()

The IPv6 address defined in struct in6_addr is specified as
big endian, but there is no specified endian in struct
hclge_fd_rule_tuples, so it  will cause a problem if directly
use memcpy() to copy ipv6 address between these two structures
since this field in struct hclge_fd_rule_tuples is little endian.

This patch fixes this problem by using be32_to_cpu() to convert
endian of IPv6 address of struct in6_addr before copying.

Fixes: 311b0277f0f2 ("net: hns3: add aRFS support for PF")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c