From: Alex Elder Date: Fri, 11 Jun 2021 19:05:22 +0000 (-0500) Subject: net: qualcomm: rmnet: use ip_is_fragment() X-Git-Tag: v5.15.73~11674^2~200^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4517d8a7f07b18f4f0e68940e2822a1b92b471f;p=platform%2Fkernel%2Flinux-rpi.git net: qualcomm: rmnet: use ip_is_fragment() In rmnet_map_ipv4_dl_csum_trailer() use ip_is_fragment() to determine whether a socket buffer contains a packet fragment. Signed-off-by: Alex Elder Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index cecf72be5102..34bd1a98a101 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -50,8 +50,9 @@ rmnet_map_ipv4_dl_csum_trailer(struct sk_buff *skb, __be16 addend; ip4h = (struct iphdr *)(skb->data); - if ((ntohs(ip4h->frag_off) & IP_MF) || - ((ntohs(ip4h->frag_off) & IP_OFFSET) > 0)) { + + /* We don't support checksum offload on IPv4 fragments */ + if (ip_is_fragment(ip4h)) { priv->stats.csum_fragmented_pkt++; return -EOPNOTSUPP; }