diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-11-10 18:12:08 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-11-10 18:12:08 +0000 |
commit | bcb1bc6369b44ba6f4ed0b3e16785c7f7adf4bab (patch) | |
tree | 4f4f31a8f2a0cc4f8060fb1c8da2520e9f6238b1 | |
parent | f86276552fef287389316ee45b3eb4836ce6d990 (diff) |
sync with kame.
- allow -s (data len) that are < 8.
- more fflush.
-rw-r--r-- | sbin/ping6/ping6.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 3f737e334c8..893e300344d 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ping6.c,v 1.15 2000/10/12 14:13:10 itojun Exp $ */ -/* $KAME: ping6.c,v 1.93 2000/10/12 10:27:00 itojun Exp $ */ +/* $OpenBSD: ping6.c,v 1.16 2000/11/10 18:12:07 itojun Exp $ */ +/* $KAME: ping6.c,v 1.99 2000/11/08 09:55:45 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -215,6 +215,7 @@ char *hostname; int ident; /* process id to identify our packets */ u_int8_t nonce[8]; /* nonce field for node information */ struct in6_addr srcaddr; +int hoplimit = -1; /* hoplimit */ /* counters */ long npackets; /* max packets to transmit */ @@ -222,7 +223,6 @@ long nreceived; /* # of packets we got back */ long nrepeats; /* number of duplicates */ long ntransmitted; /* sequence # for outbound packets = #sent */ struct timeval interval = {1, 0}; /* interval between packets */ -int hoplimit = -1; /* hoplimit */ /* timing */ int timing; /* flag to do timing */ @@ -559,10 +559,12 @@ main(argc, argv) if (options & F_FLOOD && options & F_INTERVAL) errx(1, "-f and -i incompatible options"); - if ((options & F_NOUSERDATA) == 0 && - datalen >= sizeof(struct timeval)) { - /* can we time transfer */ - timing = 1; + if ((options & F_NOUSERDATA) == 0) { + if (datalen >= sizeof(struct timeval)) { + /* we can time transfer */ + timing = 1; + } else + timing = 0; } else { /* suppress timing for node information query */ timing = 0; @@ -1548,8 +1550,8 @@ pr_ip6opt(void *extbuf) ext = (struct ip6_hbh *)extbuf; extlen = (ext->ip6h_len + 1) * 8; - printf("nxt %u, len %u (%d bytes)\n", ext->ip6h_nxt, - ext->ip6h_len, extlen); + printf("nxt %u, len %u (%lu bytes)\n", ext->ip6h_nxt, + (unsigned int)ext->ip6h_len, (unsigned long)extlen); currentlen = 0; while (1) { @@ -1577,7 +1579,8 @@ pr_ip6opt(void *extbuf) ntohs(value2)); break; default: - printf(" Received Opt %u len %u\n", type, len); + printf(" Received Opt %u len %lu\n", + type, (unsigned long)len); break; } } @@ -1785,6 +1788,7 @@ summary() #endif (void)fflush(stdout); } + (void)fflush(stdout); } /*subject type*/ |