提交 198d5fd0 编写于 作者: A Alaa Hleihel 提交者: Xie XiuQi

net/mlx5e: don't set CHECKSUM_COMPLETE on SCTP packets

mainline inclusion
from mainline-4.20
commit fe1dc069
category: bugfix
bugzilla: 6077
CVE: NA

-------------------------------------------------

CHECKSUM_COMPLETE is not applicable to SCTP protocol.
Setting it for SCTP packets leads to CRC32c validation failure.

Fixes: bbceefce ("net/mlx5e: Support RX CHECKSUM_COMPLETE")
Signed-off-by: NAlaa Hleihel <alaa@mellanox.com>
Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: NKeefe LIU <liuqifa@huawei.com>
Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 84474b58
......@@ -727,6 +727,14 @@ static u32 mlx5e_get_fcs(const struct sk_buff *skb)
#define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN)
static u8 get_ip_proto(struct sk_buff *skb, __be16 proto)
{
void *ip_p = skb->data + sizeof(struct ethhdr);
return (proto == htons(ETH_P_IP)) ? ((struct iphdr *)ip_p)->protocol :
((struct ipv6hdr *)ip_p)->nexthdr;
}
static inline void mlx5e_handle_csum(struct net_device *netdev,
struct mlx5_cqe64 *cqe,
struct mlx5e_rq *rq,
......@@ -758,6 +766,9 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
goto csum_unnecessary;
if (likely(is_last_ethertype_ip(skb, &network_depth, &proto))) {
if (unlikely(get_ip_proto(skb, proto) == IPPROTO_SCTP))
goto csum_unnecessary;
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
if (network_depth > ETH_HLEN)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册