Selaa lähdekoodia

rmnet_core: pass correct length to ip_fast_csum

ip_fast_csum() takes in the header length in 4-byte words, not the length
in bytes.

Change-Id: Ib3941876e21260aad32ed761427714e133220cfb
Signed-off-by: Sean Tranchetti <[email protected]>
Sean Tranchetti 3 vuotta sitten
vanhempi
sitoutus
48a12a6f04
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      core/rmnet_descriptor.c

+ 2 - 1
core/rmnet_descriptor.c

@@ -1,4 +1,5 @@
 /* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -1558,7 +1559,7 @@ static int rmnet_frag_checksum_pkt(struct rmnet_frag_descriptor *frag_desc)
 
 		csum_len -= frag_desc->ip_len;
 		/* IPv4 checksum must be valid */
-		if (ip_fast_csum((u8 *)iph, frag_desc->ip_len)) {
+		if (ip_fast_csum((u8 *)iph, iph->ihl)) {
 			priv->stats.csum_sw++;
 			return 0;
 		}