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/31cabd286f51
branches: trunk
changeset: 352119:31cabd286f51
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 e138d2b15831 -r 31cabd286f51 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