net: qualcomm: rmnet: use ip_is_fragment()
authorAlex Elder <elder@linaro.org>
Fri, 11 Jun 2021 19:05:22 +0000 (14:05 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:37:49 +0000 (13:37 -0700)
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 <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c

index cecf72be5102952eec37a43b88545671ea5f6d32..34bd1a98a1015833a6925f17044f31eb0dfdef56 100644 (file)
@@ -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;
        }