remove net.inet6.ip6.nd6_proxyall sysctl.
support "ndp -s <ip6> <mac> proxy" for proxy NDP.
This commit is contained in:
parent
1450d6e643
commit
6a433be509
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: sysctl.3,v 1.50 2000/02/15 20:14:48 thorpej Exp $
|
||||
.\" $NetBSD: sysctl.3,v 1.51 2000/02/26 08:48:21 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -779,7 +779,6 @@ The currently defined protocols and names are:
|
|||
.It icmp6 nd6_umaxtries integer yes
|
||||
.It icmp6 nd6_mmaxtries integer yes
|
||||
.It icmp6 nd6_useloopback integer yes
|
||||
.It icmp6 nd6_proxyall integer yes
|
||||
.It icmp6 nodeinfo integer yes
|
||||
.It tcp6 mssdflt integer yes
|
||||
.It tcp6 do_rfc1323 integer yes
|
||||
|
@ -919,8 +918,6 @@ constant in IPv6 neighbor discovery specification
|
|||
.It Li icmp6.nd6_useloopback
|
||||
If set to non-zero, kernel IPv6 stack will use loopback interface for
|
||||
local traffic.
|
||||
.It Li icmp6.nd6_proxyall
|
||||
The variable enables proxy neighbor advertisements.
|
||||
.It Li icmp6.nodeinfo
|
||||
The variable enables, or disables, kernel support for
|
||||
ICMPv6 node information query/reply.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: sysctl.8,v 1.42 2000/02/17 08:54:16 fvdl Exp $
|
||||
.\" $NetBSD: sysctl.8,v 1.43 2000/02/26 08:48:22 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -221,7 +221,6 @@ privilege can change the value.
|
|||
.It net.inet6.icmp6.errratelimit integer yes
|
||||
.It net.inet6.icmp6.nd6_delay integer yes
|
||||
.It net.inet6.icmp6.nd6_mmaxtries integer yes
|
||||
.It net.inet6.icmp6.nd6_proxyall integer yes
|
||||
.It net.inet6.icmp6.nd6_prune integer yes
|
||||
.It net.inet6.icmp6.nd6_umaxtries integer yes
|
||||
.It net.inet6.icmp6.nd6_useloopback integer yes
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $NetBSD: ndp.8,v 1.4 1999/12/13 15:30:25 itojun Exp $
|
||||
.\" KAME Id: ndp.8,v 1.4 1999/12/13 11:07:41 jinmei Exp
|
||||
.\" $NetBSD: ndp.8,v 1.5 2000/02/26 08:48:22 itojun Exp $
|
||||
.\" KAME Id: ndp.8,v 1.5 2000/02/17 05:35:56 itojun Exp
|
||||
.\"
|
||||
.Dd May 17, 1998
|
||||
.Dt NDP 8
|
||||
|
@ -75,7 +75,8 @@
|
|||
.Op Fl nt
|
||||
.Ar nodename
|
||||
.Ar ether_addr
|
||||
.Op temp
|
||||
.Op Li temp
|
||||
.Op Li proxy
|
||||
.\"
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
|
@ -128,6 +129,15 @@ Show default router list.
|
|||
Flush all the entries in the default router list.
|
||||
.It Fl s
|
||||
Register a NDP entry for a node.
|
||||
The entry will be permanent unless the word
|
||||
.Li temp
|
||||
is given in the command.
|
||||
If the word
|
||||
.Li proxy
|
||||
is given, this system will act as an proxy NDP server,
|
||||
responding to requests for
|
||||
.Ar hostname
|
||||
even though the host address is not its own.
|
||||
.It Fl t
|
||||
Print timestamp on each entries,
|
||||
to make it possible to merge output with
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $NetBSD: ndp.c,v 1.5 2000/01/22 10:18:07 tron Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
|
||||
* All rights reserved.
|
||||
|
@ -338,7 +336,7 @@ getsocket()
|
|||
}
|
||||
}
|
||||
|
||||
struct sockaddr_in so_mask = {8, 0, 0, { 0xffffffff}};
|
||||
struct sockaddr_in6 so_mask = {sizeof(so_mask), AF_INET6 };
|
||||
struct sockaddr_in6 blank_sin = {sizeof(blank_sin), AF_INET6 }, sin_m;
|
||||
struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m;
|
||||
int expire_time, flags, found_entry;
|
||||
|
@ -387,7 +385,8 @@ set(argc, argv)
|
|||
struct timeval time;
|
||||
gettimeofday(&time, 0);
|
||||
expire_time = time.tv_sec + 20 * 60;
|
||||
}
|
||||
} else if (strncmp(argv[0], "proxy", 5) == 0)
|
||||
flags |= RTF_ANNOUNCE;
|
||||
argv++;
|
||||
}
|
||||
tryagain:
|
||||
|
@ -645,17 +644,19 @@ again:;
|
|||
* other flags. R: router, P: proxy, W: ??
|
||||
*/
|
||||
if ((rtm->rtm_addrs & RTA_NETMASK) == 0) {
|
||||
snprintf(flgbuf, sizeof(flgbuf), "%s",
|
||||
isrouter ? "R" : "");
|
||||
snprintf(flgbuf, sizeof(flgbuf), "%s%s",
|
||||
isrouter ? "R" : "",
|
||||
(rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : "");
|
||||
} else {
|
||||
sin = (struct sockaddr_in6 *)
|
||||
(sdl->sdl_len + (char *)sdl);
|
||||
snprintf(flgbuf, sizeof(flgbuf), "%s%s%s",
|
||||
snprintf(flgbuf, sizeof(flgbuf), "%s%s%s%s",
|
||||
isrouter ? "R" : "",
|
||||
!IN6_IS_ADDR_UNSPECIFIED(&sin->sin6_addr)
|
||||
? "P" : "",
|
||||
(sin->sin6_len != sizeof(struct sockaddr_in6))
|
||||
? "W" : "");
|
||||
? "W" : "",
|
||||
(rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : "");
|
||||
}
|
||||
printf(" %-4.4s", flgbuf);
|
||||
|
||||
|
@ -750,7 +751,7 @@ usage()
|
|||
#endif
|
||||
printf(" ndp -p\n");
|
||||
printf(" ndp -r\n");
|
||||
printf(" ndp -s hostname ether_addr [temp]\n");
|
||||
printf(" ndp -s hostname ether_addr [temp] [proxy]\n");
|
||||
printf(" ndp -H\n");
|
||||
printf(" ndp -P\n");
|
||||
printf(" ndp -R\n");
|
||||
|
@ -783,6 +784,10 @@ rtmsg(cmd)
|
|||
rtm->rtm_rmx.rmx_expire = expire_time;
|
||||
rtm->rtm_inits = RTV_EXPIRE;
|
||||
rtm->rtm_flags |= (RTF_HOST | RTF_STATIC);
|
||||
if (rtm->rtm_flags & RTF_ANNOUNCE) {
|
||||
rtm->rtm_flags &= ~RTF_HOST;
|
||||
rtm->rtm_flags |= RTA_NETMASK;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case RTM_GET:
|
||||
rtm->rtm_addrs |= RTA_DST;
|
||||
|
@ -793,6 +798,7 @@ rtmsg(cmd)
|
|||
|
||||
NEXTADDR(RTA_DST, sin_m);
|
||||
NEXTADDR(RTA_GATEWAY, sdl_m);
|
||||
memset(&so_mask.sin6_addr, 0xff, sizeof(so_mask.sin6_addr));
|
||||
NEXTADDR(RTA_NETMASK, so_mask);
|
||||
|
||||
rtm->rtm_msglen = cp - (char *)&m_rtmsg;
|
||||
|
@ -914,7 +920,12 @@ plist()
|
|||
sizeof(ntop_buf)), PR.prefixlen,
|
||||
if_indextoname(PR.if_index, ifix_buf));
|
||||
gettimeofday(&time, 0);
|
||||
printf(" flags=%s%s",
|
||||
/*
|
||||
* meaning of fields, especially flags, is very different
|
||||
* by origin. notify the difference to the users.
|
||||
*/
|
||||
printf(" %s", PR.origin == PR_ORIG_RA ? "" : "advertise: ");
|
||||
printf("flags=%s%s",
|
||||
PR.raflags.onlink ? "L" : "",
|
||||
PR.raflags.autonomous ? "A" : "");
|
||||
if (PR.vltime == ND6_INFINITE_LIFETIME)
|
||||
|
@ -926,13 +937,37 @@ plist()
|
|||
else
|
||||
printf(", pltime=%ld", (long)PR.pltime);
|
||||
if (PR.expire == 0)
|
||||
printf(", expire=Never\n");
|
||||
printf(", expire=Never");
|
||||
else if (PR.expire >= time.tv_sec)
|
||||
printf(", expire=%s\n",
|
||||
printf(", expire=%s",
|
||||
sec2str(PR.expire - time.tv_sec));
|
||||
else
|
||||
printf(", expired\n");
|
||||
if (PR.advrtrs) {
|
||||
printf(", expired");
|
||||
switch (PR.origin) {
|
||||
case PR_ORIG_RA:
|
||||
printf(", origin=RA");
|
||||
break;
|
||||
case PR_ORIG_RR:
|
||||
printf(", origin=RR");
|
||||
break;
|
||||
case PR_ORIG_STATIC:
|
||||
printf(", origin=static");
|
||||
break;
|
||||
case PR_ORIG_KERNEL:
|
||||
printf(", origin=kernel");
|
||||
break;
|
||||
default:
|
||||
printf(", origin=?");
|
||||
break;
|
||||
}
|
||||
printf("\n");
|
||||
/*
|
||||
* "advertising router" list is meaningful only if the prefix
|
||||
* information is from RA.
|
||||
*/
|
||||
if (PR.origin != PR_ORIG_RA)
|
||||
;
|
||||
else if (PR.advrtrs) {
|
||||
int j;
|
||||
printf(" advertised by\n");
|
||||
for (j = 0; j < PR.advrtrs; j++) {
|
||||
|
@ -970,8 +1005,7 @@ plist()
|
|||
if (PR.advrtrs > DRLSTSIZ)
|
||||
printf(" and %d routers\n",
|
||||
PR.advrtrs - DRLSTSIZ);
|
||||
}
|
||||
else
|
||||
} else
|
||||
printf(" No advertising router\n");
|
||||
}
|
||||
#undef PR
|
||||
|
|
Loading…
Reference in New Issue