summaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2003-07-14 12:42:47 +0000
committermaxim <maxim@FreeBSD.org>2003-07-14 12:42:47 +0000
commite6a55d01024c08591f3c3237c256184eeac0a3e8 (patch)
tree176e041dd742e9728689703cd2bfcf4a9c6e1ba9 /sbin/ping
parent3fd6e6089ef932650afd167b24fb0db588db8e33 (diff)
downloadFreeBSD-src-e6a55d01024c08591f3c3237c256184eeac0a3e8.zip
FreeBSD-src-e6a55d01024c08591f3c3237c256184eeac0a3e8.tar.gz
o Kill MINICMPLEN, there is ICMP_MINLEN already.
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index b62e635..6e6c88b 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$");
/* runs out of buffer space */
#define MAXIPLEN (sizeof(struct ip) + MAX_IPOPTLEN)
#define MAXICMPLEN (ICMP_ADVLENMIN + MAX_IPOPTLEN)
-#define MINICMPLEN ICMP_MINLEN
#define MAXWAIT 10 /* max seconds to wait for response */
#define MAXALARM (60 * 60) /* max seconds for alarm timeout */
#define MAXTOS 255
@@ -459,7 +458,7 @@ main(argc, argv)
errx(EX_USAGE, "ICMP_TSTAMP and ICMP_MASKREQ are exclusive.");
break;
}
- icmp_len = sizeof(struct ip) + MINICMPLEN + phdr_len;
+ icmp_len = sizeof(struct ip) + ICMP_MINLEN + phdr_len;
if (options & F_RROUTE)
icmp_len += MAX_IPOPTLEN;
maxpayload = IP_MAXPACKET - icmp_len;
@@ -467,7 +466,7 @@ main(argc, argv)
errx(EX_USAGE, "packet size too large: %d > %d", datalen,
maxpayload);
send_len = icmp_len + datalen;
- datap = &outpack[MINICMPLEN + phdr_len + TIMEVAL_LEN];
+ datap = &outpack[ICMP_MINLEN + phdr_len + TIMEVAL_LEN];
if (options & F_PINGFILLED) {
fill((char *)datap, payload);
}
@@ -869,11 +868,11 @@ pinger(void)
* 1000 + now.tv_usec / 1000);
if (timing)
bcopy((void *)&now,
- (void *)&outpack[MINICMPLEN + phdr_len],
+ (void *)&outpack[ICMP_MINLEN + phdr_len],
sizeof(struct timeval));
}
- cc = MINICMPLEN + phdr_len + datalen;
+ cc = ICMP_MINLEN + phdr_len + datalen;
/* compute ICMP checksum here */
icp->icmp_cksum = in_cksum((u_short *)icp, cc);
@@ -1017,7 +1016,7 @@ pr_pack(buf, cc, from, tv)
}
/* check the data */
cp = (u_char*)&icp->icmp_data[phdr_len];
- dp = &outpack[MINICMPLEN + phdr_len];
+ dp = &outpack[ICMP_MINLEN + phdr_len];
cc -= ICMP_MINLEN + phdr_len;
i = 0;
if (timing) { /* don't check variable timestamp */
@@ -1038,7 +1037,7 @@ pr_pack(buf, cc, from, tv)
(void)printf("%2x ", *cp);
}
(void)printf("\ndp:");
- cp = &outpack[MINICMPLEN];
+ cp = &outpack[ICMP_MINLEN];
for (i = 0; i < datalen; ++i, ++cp) {
if ((i % 16) == 8)
(void)printf("\n\t");
OpenPOWER on IntegriCloud