Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/ping Fix cksum calculation for clearing the cached route.



details:   https://anonhg.NetBSD.org/src/rev/9a27ac44decd
branches:  trunk
changeset: 822370:9a27ac44decd
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Mar 17 06:52:59 2017 +0000

description:
Fix cksum calculation for clearing the cached route.

In ping.c:r1.104, the size of echoreply packet was changed to ICMP_MINLEN,
Therefore also calculation size must be ICMP_MINLEN.

diffstat:

 sbin/ping/ping.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b337a79332d1 -r 9a27ac44decd sbin/ping/ping.c
--- a/sbin/ping/ping.c  Fri Mar 17 03:19:46 2017 +0000
+++ b/sbin/ping/ping.c  Fri Mar 17 06:52:59 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ping.c,v 1.115 2017/01/11 12:13:52 joerg Exp $ */
+/*     $NetBSD: ping.c,v 1.116 2017/03/17 06:52:59 ryo Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping.c,v 1.115 2017/01/11 12:13:52 joerg Exp $");
+__RCSID("$NetBSD: ping.c,v 1.116 2017/03/17 06:52:59 ryo Exp $");
 #endif
 
 #include <stdio.h>
@@ -913,7 +913,7 @@
                opack_icmp.icmp_id = ~ident;
                opack_icmp.icmp_cksum = 0;
                opack_icmp.icmp_cksum = in_cksum((u_int16_t *)&opack_icmp,
-                   phdrlen);
+                   ICMP_MINLEN);
                sw = 0;
                if (prog_setsockopt(sloop, IPPROTO_IP, IP_HDRINCL,
                               (char *)&sw, sizeof(sw)) < 0)



Home | Main Index | Thread Index | Old Index