This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e88a357fa7 net/utils: fix IPv4 checksum calculation
e88a357fa7 is described below

commit e88a357fa7ff028cd3e41c330cde70242e8d58cf
Author: Petro Karashchenko <[email protected]>
AuthorDate: Sun Apr 3 22:32:23 2022 +0200

    net/utils: fix IPv4 checksum calculation
    
    Signed-off-by: Petro Karashchenko <[email protected]>
---
 net/utils/net_ipchksum.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/utils/net_ipchksum.c b/net/utils/net_ipchksum.c
index 0bde29b255..c9242cc88e 100644
--- a/net/utils/net_ipchksum.c
+++ b/net/utils/net_ipchksum.c
@@ -96,7 +96,7 @@ uint16_t ipv4_upperlayer_chksum(FAR struct net_driver_s *dev, 
uint8_t proto)
 
   /* Sum IP source and destination addresses. */
 
-  sum = chksum(sum, (FAR uint8_t *)&ipv4->srcipaddr, sizeof(in_addr_t));
+  sum = chksum(sum, (FAR uint8_t *)&ipv4->srcipaddr, 2 * sizeof(in_addr_t));
 
   /* Sum IP payload data. */
 

Reply via email to