Sync with latest KAME

Obtained from:	KAME
This commit is contained in:
Kris Kennaway 2000-07-07 07:35:51 +00:00
parent 2637b5fb5d
commit 2b39a7c8ef
3 changed files with 16 additions and 19 deletions

View file

@ -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$

View file

@ -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

View file

@ -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));
}