Fix traceroute where [number of hops] * [number of packets per hop] > 255.

PR:		misc/61336
Submitted by:	Mike Hibler <mike@cs.utah.edu>
Approved by:	rwatson (mentor)
This commit is contained in:
Colin Percival 2004-01-23 06:55:15 +00:00
parent c6609fcd7c
commit 1939168416
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124859

View File

@ -1230,7 +1230,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from,
}
if (type == ICMP_ECHOREPLY
&& proto->num == IPPROTO_ICMP
&& (*proto->check)((u_char *)icp,seq))
&& (*proto->check)((u_char *)icp, (u_char)seq))
return -2;
if ((type == ICMP_TIMXCEED && code == ICMP_TIMXCEED_INTRANS) ||
type == ICMP_UNREACH) {
@ -1242,7 +1242,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from,
inner = (u_char *)((u_char *)hip + hlen);
if (hlen + 12 <= cc
&& hip->ip_p == proto->num
&& (*proto->check)(inner, seq))
&& (*proto->check)(inner, (u_char)seq))
return (type == ICMP_TIMXCEED ? -1 : code + 1);
}
#ifndef ARCHAIC