summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2015-10-25 14:43:49 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2015-10-25 14:43:49 +0000
commit4aba7b0c5266e46fd43873d08a86479ced44ace1 (patch)
tree12e0c335a4789ec06719761bdd1bd8e58894a12d
parent7f1c0f9df7bf15b648c5c3f82e065ce87f3788b8 (diff)
IPV6_NEXTHOP is gone, remove -g option which used this.
kill it mpi@
-rw-r--r--sbin/ping6/ping6.88
-rw-r--r--sbin/ping6/ping6.c32
2 files changed, 5 insertions, 35 deletions
diff --git a/sbin/ping6/ping6.8 b/sbin/ping6/ping6.8
index 518c760f2e0..0ef24db76b6 100644
--- a/sbin/ping6/ping6.8
+++ b/sbin/ping6/ping6.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ping6.8,v 1.59 2015/10/25 13:05:56 jmc Exp $
+.\" $OpenBSD: ping6.8,v 1.60 2015/10/25 14:43:48 florian Exp $
.\" $KAME: ping6.8,v 1.57 2002/05/26 13:18:25 itojun Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -38,7 +38,6 @@
.Nm ping6
.Op Fl dEefHLmnqv
.Op Fl c Ar count
-.Op Fl g Ar gateway
.Op Fl h Ar hoplimit
.Op Fl I Ar sourceaddr
.Op Fl i Ar wait
@@ -107,11 +106,6 @@ Only the super-user may use this option.
.Bf -emphasis
This can be very hard on a network and should be used with caution.
.Ef
-.It Fl g Ar gateway
-Specifies to use
-.Ar gateway
-as the next hop to the destination.
-The gateway must be a neighbor of the sending node.
.It Fl H
Specifies to try reverse-lookup of IPv6 addresses.
The
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index 02d0dc6f948..60515c5d4b0 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.132 2015/10/25 12:47:26 florian Exp $ */
+/* $OpenBSD: ping6.c,v 1.133 2015/10/25 14:43:48 florian Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
@@ -233,7 +233,7 @@ main(int argc, char *argv[])
int ch, i, maxsize, packlen, preload, optval, error;
socklen_t maxsizelen;
u_char *datap, *packet;
- char *e, *target, *gateway = NULL;
+ char *e, *target;
const char *errstr;
int ip6optlen = 0;
struct cmsghdr *scmsgp = NULL;
@@ -254,7 +254,7 @@ main(int argc, char *argv[])
preload = 0;
datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN];
while ((ch = getopt(argc, argv,
- "c:dEefg:Hh:I:i:Ll:mNnp:qS:s:V:vw:")) != -1) {
+ "c:dEefHh:I:i:Ll:mNnp:qS:s:V:vw:")) != -1) {
switch (ch) {
case 'c':
npackets = strtonum(optarg, 0, INT_MAX, &errstr);
@@ -280,9 +280,6 @@ main(int argc, char *argv[])
options |= F_FLOOD;
setbuf(stdout, (char *)NULL);
break;
- case 'g':
- gateway = optarg;
- break;
case 'H':
options |= F_HOSTNAME;
break;
@@ -429,27 +426,6 @@ main(int argc, char *argv[])
err(1, "bind");
}
- /* set the gateway (next hop) if specified */
- if (gateway) {
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_INET6;
- hints.ai_socktype = SOCK_RAW;
- hints.ai_protocol = IPPROTO_ICMPV6;
-
- error = getaddrinfo(gateway, NULL, &hints, &res0);
- if (error)
- errx(1, "gateway %s: %s", gateway, gai_strerror(error));
-
- if (res0->ai_next && (options & F_VERBOSE))
- warnx("gateway resolves to multiple addresses");
-
- if (setsockopt(s, IPPROTO_IPV6, IPV6_NEXTHOP, res0->ai_addr,
- res0->ai_addrlen))
- err(1, "setsockopt(IPV6_NEXTHOP)");
-
- freeaddrinfo(res0);
- }
-
/*
* let the kernel pass extension headers of incoming packets,
* for privileged socket options
@@ -1658,7 +1634,7 @@ void
usage(void)
{
(void)fprintf(stderr,
- "usage: ping6 [-dEefHLmnqv] [-c count] [-g gateway] [-h hoplimit] "
+ "usage: ping6 [-dEefHLmnqv] [-c count] [-h hoplimit] "
"[-I sourceaddr]\n\t[-i wait] [-l preload] [-p pattern] "
"[-s packetsize] [-V rtable]\n\t[-w maxwait] host\n");
exit(1);