]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 26 Feb 2020 02:57:41 +0000 (20:57 -0600)
commit11b5056d218f43a18d0c91a01a690e6b30dc1d14
treed5f3ee0ee400cda76d0b949c5376459a8bd50db2
parent91f86d270edd2c2754dce133cc2bbb4a6749c7a6
net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()

BugLink: https://launchpad.net/bugs/1863575
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: d93ed94fbeaf ("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>
(cherry picked from commit 47327c9315b2f3ae4ab659457977a26669631f20)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c