net/mlx5: fix ICMPv6 header rewrite action validation
authorShiri Kuzin <shirik@mellanox.com>
Tue, 18 Feb 2020 11:52:54 +0000 (13:52 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 19 Feb 2020 14:17:30 +0000 (15:17 +0100)
ICMPv6 header contains the checksum field, that includes the IP
addresses from IP header.

The ConnectX-5 hardware does not support ICMPv6 checksum calculation
and in case of IP header modification the checksum will contain
the wrong value.

The patch rejects the header modification actions related to IP
addresses if ICMPv6 protocol is detected in pattern.
This issue was also partly fixed in commit below which rejects
flows with the pattern "ipv6 proto is 58".

Fixes: 0e2ceb639d8a ("net/mlx5: fix ICMPv6 header rewrite actions")
Cc: stable@dpdk.org
Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5_flow_dv.c

index 341d511..1c01269 100644 (file)
@@ -4621,6 +4621,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
                                                            error);
                        if (ret < 0)
                                return ret;
+                       item_ipv6_proto = IPPROTO_ICMPV6;
                        last_item = MLX5_FLOW_LAYER_ICMP6;
                        break;
                case RTE_FLOW_ITEM_TYPE_TAG: