Commit Graph

128 Commits

Author SHA1 Message Date
maxv b5d4b113f7 Add code 3 of paramprob, part of RFC7112: "IPv6 First Fragment has
incomplete IPv6 Header Chain". Handle this code in ping6.
2018-04-24 07:22:32 +00:00
maxv 519a11ad08 Remove annoying (void) casts. 2018-04-24 07:12:04 +00:00
maxv f025b20b34 Remove double include and unused macros. 2018-04-23 18:48:30 +00:00
maxv f4598fe58b Remove the "-R" option. It uses IPV6_REACHCONF, but we've never had
this.
2018-04-23 18:44:39 +00:00
maxv fa0be10b46 Fix usage(), A/E don't exist. 2018-04-23 18:37:19 +00:00
maxv ed8f79525d Simplify: remove #ifdefs for constants that are always defined, and
remove their #else's (some of which can't compile, since they use values
that since got removed).
2018-04-23 18:32:18 +00:00
maxv a845eccede Remove dead/broken code, we want to favor RFC3542 over RFC2292. No
functional change. traceroute6 and rtadvd did the same.
2018-04-23 10:35:20 +00:00
wiz da9f189127 Sort options. Sort option descriptions. Remove Tn.
Sync usage (more) with man page.
2018-04-23 07:25:36 +00:00
maxv 9948652569 Remove the "hops" parameter, it uses RH0, which is deprecated by RFC5095,
and doesn't work on modern networks anymore.
2018-04-23 06:51:25 +00:00
maxv bc7ed98e99 typo in comment 2018-04-15 08:27:21 +00:00
christos 030580eaff user librumpres 2017-10-10 19:30:06 +00:00
dholland 885f1ddec5 Merge the PR 36997 fixes into ping6. It already didn't accept too
small or wildly too large intervals, but it did allow intervals that
failed at poll(). Since that's signed integer overflow and thus UB,
better not to.
2016-12-18 01:30:54 +00:00
riastradh fdeab11495 #ifdef forward declaration of setpolicy like definition. 2016-02-29 16:25:06 +00:00
ozaki-r c2e5d2b795 Fix rump.ping6 -c N (N > 1) doesn't work
2nd packet and subsequent packets are sent based on SIGALRM and
it depends on poll(2) returns with EINTR by the signal. However,
currently poll is rump-ified while signals aren't so the signal
doesn't wake up poll and ping6 doesn't work expectedly.

Rump-ifying signals is unsure (nobody does it for now) and the
combination use of signals and poll makes the logic a bit complex.
So let's fix the defect by stopping using signals for packet
transmissions. The new logic is derived from ping(8).

Bonus: ping6 -i 0.01 works as we expect now while the original
didn't work enough fast.
2015-11-04 08:07:54 +00:00
ozaki-r c94323a777 Fix exit status when -c and -X is used
It exited with status 0 when at least one packet was received
and timed out. However, when we specify -c N (while N > 0),
we expect that it fails if it times out before all sent requests
are replied.
2015-11-04 07:59:25 +00:00
knakahara fad49cfc60 rump.ping6 supports "-S" option. 2015-11-04 01:14:02 +00:00
ozaki-r 0cea365c35 Include several libc functions in rump.ping6
We need getaddrinfo, getifaddrs, if_indextoname and if_nametoindex
in addition to getnameinfo.
2015-09-09 10:06:05 +00:00
ozaki-r 2a4e5e0f61 Introduce rump.ping6
We use ping6 frequently in ATF tests so let's have rump-ified one.
2015-08-06 14:45:54 +00:00
kefren 0c4c07ab30 Add options -X for deadline and -x for reply maxwait (flag names matching
FreeBSD). Unline FreeBSD, currently -x doesn't count late packets to statistics.
After discussion with, and help from ozaki-r@
Should fix PR/49896
2015-05-15 08:02:39 +00:00
christos 8e83ba138f Add the once -o option like ping 2015-04-24 00:42:56 +00:00
ozaki-r ba4f0be24c Remove out-of-date comments 2014-09-17 01:00:41 +00:00
christos 6b3fd816dd PR/49206: ping6 dies with SIGINT even when it just fails to ping
When reusing the same handler for SIGALRM, make don't pretend you
got SIGINT.
2014-09-16 21:29:12 +00:00
matt 4e8f1b53e9 Rework to be avoid a conditional assignment which results in:
sbin/ping6/ping6.c:1879:8: error: 'cbit.skip' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cur += ntohs(cbit.skip) * 32;
2014-08-22 20:54:29 +00:00
christos dc30329cc3 avoit type punning 2013-10-19 01:09:16 +00:00
msaitoh 5699fb2d89 Accept "-s 0" 2012-09-10 04:32:24 +00:00
wiz 1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
drochner 8fd6dadaf8 include <netipsec/ipsec.h> rather than <netinet6/ipsec.h> from userland
where possible, for consistency and compatibility to FreeBSD
(exception: KAME specific statistics gathering in netstat(1) and systat(1))
2012-01-04 16:09:40 +00:00
drochner 3712f81ced -consistently use "char *" for the compiled policy buffer in the
ipsec_*_policy() functions, as it was documented and used by clients
-remove "ipsec_policy_t" which was undocumented and only present
 in the KAME version of the ipsec.h header
-misc cleanup of historical artefacts, and to remove unnecessary
 differences between KAME ans FAST_IPSEC
2012-01-04 15:55:35 +00:00
plunky 2b8aaed8cd NULL does not need a cast, here 2011-09-16 16:13:16 +00:00
christos 9bf741a041 put back the byte swapping code, and remove the double byte swapping. 2011-08-31 22:27:26 +00:00
riz e14f406cd9 Remove erroneous seq=ntohs(seq) introduced in rev. 1.74, which caused
icmp_seq numbers to increment by 256 instead of 1 on LE platforms.
2011-08-31 22:05:57 +00:00
joerg 3fedada239 static + __dead + G/C pathmtu 2011-08-27 18:43:24 +00:00
christos 82f7376491 fix gcc warnings and eliminate duplicate code. 2011-08-14 12:09:35 +00:00
mrg c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
ahoka 592d1c274a Avoid NaN when calculating std-dev, which fixes a crash on VAX. 2010-09-20 11:49:48 +00:00
lukem 002fe60580 fix sign-compare issues 2009-04-11 07:40:37 +00:00
dholland 866d811ed8 Fix reversed test in connection with combining -i and -l. If some
packets have already sent because of the preload count handling, we
shouldn't start off by sending another one right away. The reversed
test causes ping6 to wait one interval before sending anything at all
if you don't use -l. PR bin/39732.
2008-10-13 13:47:35 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
elad 30d1b3f220 PR/30226: Nino Dehne: ping6(8) and ping(8) are inconsistent in the output
of round-trip times.

okay rpaulo@
2006-09-23 16:18:04 +00:00
rpaulo 25ff2bc882 Replace the way we calculate the standard deviation with the unbiased form
for non-related samples. There are several websites that explain why we
should use this form instead of the normal formula to compute the std. dev.
(Wikipedia is one of them).
Also, ping(8) (where this "new" formula came from) already does it this way
so, I'm trying to score some extra points by making both utilities behave
the same way.

Thanks to wrtstuden@ for the initial clarification.
2006-05-18 02:14:22 +00:00
rpaulo 83dc99da2a There are no broadcast addresses in IPv6, so, kill a leftover from the
ping(8) man page.
2006-05-18 00:50:08 +00:00
rpaulo 84f73e685c Remove support support for RFC 2292. 2006-05-07 16:00:18 +00:00
rpaulo 848d0be7cc len should be socklen_t, not size_t. Spotted by
Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>.
2006-05-05 12:49:23 +00:00
rpaulo de8db47547 Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (www.kame.net).
Reviewed by core.
2006-05-05 00:03:21 +00:00
elad 21831d5e1d Fix an off-by-one found by Coverity, CID 1456.
I haven't looked, but I suggest security-officer@ looks into it to see if
this may be exploited passively?
2006-03-17 02:31:03 +00:00
christos 2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
he 2e34fff7c9 Add an initialization to appease -Wuninitialized.
Marked with XXXGCC for sun2 (found while building for it).

Reviewed by lukem.
2005-06-07 09:10:33 +00:00
lukem 658ed3362c appease gcc -Wuninitialized 2005-06-02 01:35:57 +00:00
xtraeme 39707ce809 Kill __P(), use ANSI function declarations; WARNS=3. 2005-02-09 14:09:46 +00:00
dsl 91d3fe12d9 Add (unsigned char) cast to ctype function 2004-10-29 19:15:20 +00:00