summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2000-07-07 07:35:51 +0000
committerKris Kennaway <kris@FreeBSD.org>2000-07-07 07:35:51 +0000
commit2b39a7c8ef19ea8d5721b74c932e7c931ef5bfff (patch)
tree2625b526630ebd43fe93a3dec7f3751d84203fba
parent2637b5fb5de2af815fa4aca977c7b1a21305736c (diff)
Notes
-rw-r--r--usr.sbin/rip6query/Makefile1
-rw-r--r--usr.sbin/rip6query/rip6query.810
-rw-r--r--usr.sbin/rip6query/rip6query.c24
3 files changed, 16 insertions, 19 deletions
diff --git a/usr.sbin/rip6query/Makefile b/usr.sbin/rip6query/Makefile
index 8a0cd40147a3..4257e98b9777 100644
--- a/usr.sbin/rip6query/Makefile
+++ b/usr.sbin/rip6query/Makefile
@@ -1,3 +1,4 @@
+# $NetBSD: Makefile,v 1.7 1995/03/18 14:56:21 cgd Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
diff --git a/usr.sbin/rip6query/rip6query.8 b/usr.sbin/rip6query/rip6query.8
index bd64068d3575..d77e6d0d11fb 100644
--- a/usr.sbin/rip6query/rip6query.8
+++ b/usr.sbin/rip6query/rip6query.8
@@ -1,7 +1,7 @@
.\"
.\" Copyright (C) 1998 and 1999 WIDE Project.
.\" All rights reserved.
-.\"
+.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -13,7 +13,7 @@
.\" 3. Neither the name of the project nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
-.\"
+.\"
.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -26,12 +26,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: rip6query.8,v 1.1 1999/10/07 05:36:36 itojun Exp $
+.\" $Id: rip6query.8,v 1.2 2000/01/19 06:24:55 itojun Exp $
.\" $FreeBSD$
.\"
.Dd Oct 7, 1999
.Dt RIP6QUERY 8
-.Os KAME
+.Os
.Sh NAME
.Nm rip6query
.Nd RIPng debugging tool
@@ -54,7 +54,7 @@ and is useful when link-local address is specified for
.Ar destination .
.\"
.Sh SEE ALSO
-.Xr route6d 8 .
+.Xr route6d 8
.\"
.Sh HISTORY
The
diff --git a/usr.sbin/rip6query/rip6query.c b/usr.sbin/rip6query/rip6query.c
index 523b17f149d8..ed0f6f98765c 100644
--- a/usr.sbin/rip6query/rip6query.c
+++ b/usr.sbin/rip6query/rip6query.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -13,7 +13,7 @@
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -36,12 +36,15 @@
#include <string.h>
#include <ctype.h>
#include <signal.h>
+#include <errno.h>
#include <err.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
+#endif /* __FreeBSD__ >= 3 */
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <arpa/inet.h>
@@ -51,11 +54,10 @@
/* wrapper for KAME-special getnameinfo() */
#ifndef NI_WITHSCOPEID
-#define NI_WITHSCOPEID 0
+#define NI_WITHSCOPEID 0
#endif
int s;
-extern int errno;
struct sockaddr_in6 sin6;
struct rip6 *ripbuf;
@@ -75,8 +77,6 @@ main(argc, argv)
struct sockaddr_in6 fsock;
int i, n, len, flen;
int c;
- extern char *optarg;
- extern int optind;
int ifidx = -1;
int error;
char pbuf[10];
@@ -114,14 +114,10 @@ main(argc, argv)
snprintf(pbuf, sizeof(pbuf), "%d", RIP6_PORT);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
- hints.ai_socktype = SOCK_STREAM;
+ hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo(argv[0], pbuf, &hints, &res);
if (error) {
- fprintf(stderr, "rip6query: %s: %s\n", argv[0],
- gai_strerror(error));
- if (error == EAI_SYSTEM)
- errx(1, "%s", strerror(errno));
- exit(1);
+ errx(1, "%s: %s", argv[0], gai_strerror(error));
/*NOTREACHED*/
}
if (res->ai_next) {
@@ -189,7 +185,7 @@ static const char *
sa_n2a(sa)
struct sockaddr *sa;
{
- static char buf[BUFSIZ];
+ static char buf[NI_MAXHOST];
if (getnameinfo(sa, sa->sa_len, buf, sizeof(buf),
NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID) != 0) {
@@ -202,7 +198,7 @@ static const char *
inet6_n2a(addr)
struct in6_addr *addr;
{
- static char buf[BUFSIZ];
+ static char buf[NI_MAXHOST];
return inet_ntop(AF_INET6, addr, buf, sizeof(buf));
}