summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-01-21 15:11:20 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-01-21 15:11:20 +0000
commitff39e4b9b57cd27df5b71896ea8d982696b72cb4 (patch)
tree278b797cc7a60791192a3526aaa9f1db3b484488 /usr.sbin
parent62a407e823464c1189b3a2ee7beec60953294a1e (diff)
do not intsall rtadvd.conf into /etc, it is not required to use it
(rtadvd will derive the configuration from kernel settings). make it clearer that rtadvd.conf is not necessary, in manpage. sync with kame.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rtadvd/config.c80
-rw-r--r--usr.sbin/rtadvd/if.c15
-rw-r--r--usr.sbin/rtadvd/if.h5
-rw-r--r--usr.sbin/rtadvd/rtadvd.conf20
-rw-r--r--usr.sbin/rtadvd/rtadvd.conf.582
5 files changed, 60 insertions, 142 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index 51c69fb2dd3..24c1f88eb3c 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: config.c,v 1.8 2001/01/15 11:06:24 itojun Exp $ */
-/* $KAME: config.c,v 1.26 2000/12/25 12:19:27 itojun Exp $ */
+/* $OpenBSD: config.c,v 1.9 2001/01/21 15:11:18 itojun Exp $ */
+/* $KAME: config.c,v 1.27 2001/01/19 03:07:18 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -433,81 +433,6 @@ getconfig(intface)
static void
get_prefix(struct rainfo *rai)
{
-#if 0
- size_t len;
- u_char *buf, *lim, *next;
- u_char ntopbuf[INET6_ADDRSTRLEN];
-
- if ((len = rtbuf_len()) < 0) {
- syslog(LOG_ERR,
- "<%s> can't get buffer length for routing info",
- __FUNCTION__);
- exit(1);
- }
- if ((buf = malloc(len)) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't allocate buffer", __FUNCTION__);
- exit(1);
- }
- if (get_rtinfo(buf, &len) < 0) {
- syslog(LOG_ERR,
- "<%s> can't get routing inforamtion", __FUNCTION__);
- exit(1);
- }
-
- lim = buf + len;
- next = get_next_msg(buf, lim, rai->ifindex, &len,
- RTADV_TYPE2BITMASK(RTM_GET));
- while (next < lim) {
- struct prefix *pp;
- struct in6_addr *a;
-
- /* allocate memory to store prefix info. */
- if ((pp = malloc(sizeof(*pp))) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't get allocate buffer for prefix",
- __FUNCTION__);
- exit(1);
- }
- memset(pp, 0, sizeof(*pp));
-
- /* set prefix and its length */
- a = get_addr(next);
- memcpy(&pp->prefix, a, sizeof(*a));
- if ((pp->prefixlen = get_prefixlen(next)) < 0) {
- syslog(LOG_ERR,
- "<%s> failed to get prefixlen "
- "or prefix is invalid",
- __FUNCTION__);
- exit(1);
- }
- syslog(LOG_DEBUG,
- "<%s> add %s/%d to prefix list on %s",
- __FUNCTION__,
- inet_ntop(AF_INET6, a, ntopbuf, sizeof(ntopbuf)),
- pp->prefixlen, rai->ifname);
-
- /* set other fields with protocol defaults */
- pp->validlifetime = DEF_ADVVALIDLIFETIME;
- pp->preflifetime = DEF_ADVPREFERREDLIFETIME;
- pp->onlinkflg = 1;
- pp->autoconfflg = 1;
- pp->origin = PREFIX_FROM_KERNEL;
-
- /* link into chain */
- insque(pp, &rai->prefix);
-
- /* counter increment */
- rai->pfxs++;
-
- /* forward pointer and get next prefix(if any) */
- next += len;
- next = get_next_msg(next, lim, rai->ifindex,
- &len, RTADV_TYPE2BITMASK(RTM_GET));
- }
-
- free(buf);
-#else
struct ifaddrs *ifap, *ifa;
struct prefix *pp;
struct in6_addr *a;
@@ -583,7 +508,6 @@ get_prefix(struct rainfo *rai)
}
freeifaddrs(ifap);
-#endif
}
static void
diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c
index f7238d63d3c..55fbb335a3b 100644
--- a/usr.sbin/rtadvd/if.c
+++ b/usr.sbin/rtadvd/if.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if.c,v 1.7 2001/01/15 11:06:25 itojun Exp $ */
-/* $KAME: if.c,v 1.15 2000/10/25 04:30:44 jinmei Exp $ */
+/* $OpenBSD: if.c,v 1.8 2001/01/21 15:11:18 itojun Exp $ */
+/* $KAME: if.c,v 1.16 2001/01/19 03:07:18 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -259,17 +259,6 @@ rtbuf_len()
return(len);
}
-int
-get_rtinfo(char *buf, size_t *len)
-{
- int mib[6] = {CTL_NET, AF_ROUTE, 0, AF_INET6, NET_RT_DUMP, 0};
-
- if (sysctl(mib, 6, buf, len, NULL, 0) < 0)
- return(-1);
-
- return(0);
-}
-
#define FILTER_MATCH(type, filter) ((0x1 << type) & filter)
#define SIN6(s) ((struct sockaddr_in6 *)(s))
#define SDL(s) ((struct sockaddr_dl *)(s))
diff --git a/usr.sbin/rtadvd/if.h b/usr.sbin/rtadvd/if.h
index 07642c0deee..9112cc8ef75 100644
--- a/usr.sbin/rtadvd/if.h
+++ b/usr.sbin/rtadvd/if.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: if.h,v 1.5 2001/01/15 11:06:26 itojun Exp $ */
-/* $KAME: if.h,v 1.4 2000/09/06 20:06:30 itojun Exp $ */
+/* $OpenBSD: if.h,v 1.6 2001/01/21 15:11:18 itojun Exp $ */
+/* $KAME: if.h,v 1.5 2001/01/19 03:07:18 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
@@ -43,7 +43,6 @@ int if_getflags __P((int ifindex, int oifflags));
int lladdropt_length __P((struct sockaddr_dl *sdl));
void lladdropt_fill __P((struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt));
int rtbuf_len __P((void));
-int get_rtinfo __P((char *buf, size_t *len));
char *get_next_msg __P((char *buf, char *lim, int ifindex, size_t *lenp,
int filter));
struct in6_addr *get_addr __P((char *buf));
diff --git a/usr.sbin/rtadvd/rtadvd.conf b/usr.sbin/rtadvd/rtadvd.conf
index bb8a496758a..213bd29f141 100644
--- a/usr.sbin/rtadvd/rtadvd.conf
+++ b/usr.sbin/rtadvd/rtadvd.conf
@@ -1,27 +1,21 @@
-#
-# common definitions.
+# $OpenBSD: rtadvd.conf,v 1.4 2001/01/21 15:11:19 itojun Exp $
+# $KAME: rtadvd.conf,v 1.12 2001/01/21 14:56:38 itojun Exp $
#
# Note: All of the following parameters have default values defined
# in specifications, and hence you usually do not have to set them
# by hand unless you need special non-default values.
#
-# You even do not need to create the configuration file. rtadvd
+# You even do not need to create the configuration file. rtadvd
# would usually work well without a configuration file.
# See also: rtadvd(8)
-#default:\
-# :chlim#64:raflags#0:rltime#1800:rtime#30000:retrans#1000:\
-# :pinfoflags#192:vltime#3600000:pltime#3600000:mtu#1500:
-#ether:\
-# :mtu#1500:tc=default:
-
# per-interface definitions.
-# Mainly IPv6 prefixes are configured in this part. However, rtadvd
+# Mainly IPv6 prefixes are configured in this part. However, rtadvd
# automatically learns appropriate prefixes from the kernel's routing
# table, and advertises the prefixes, so you don't have to configure
# this part, either.
-# If you don't want the automatic advertisement, invoke rtadvd with
-# the -s option and configure this part by hand.
+# If you don't want the automatic advertisement, (uncomment and) configure
+# this part by hand, and then invoke rtadvd with the -s option.
#ef0:\
-# :addrs#1:addr="3ffe:501:4819:1000::":prefixlen#64:tc=ether:
+# :addrs#1:addr="3ffe:501:ffff:1000::":prefixlen#64:
diff --git a/usr.sbin/rtadvd/rtadvd.conf.5 b/usr.sbin/rtadvd/rtadvd.conf.5
index 533defa7e7f..5dfae1e2e41 100644
--- a/usr.sbin/rtadvd/rtadvd.conf.5
+++ b/usr.sbin/rtadvd/rtadvd.conf.5
@@ -1,5 +1,5 @@
-.\" $OpenBSD: rtadvd.conf.5,v 1.12 2001/01/15 11:06:30 itojun Exp $
-.\" $KAME: rtadvd.conf.5,v 1.19 2001/01/15 11:02:26 itojun Exp $
+.\" $OpenBSD: rtadvd.conf.5,v 1.13 2001/01/21 15:11:19 itojun Exp $
+.\" $KAME: rtadvd.conf.5,v 1.32 2001/01/19 05:32:05 jinmei Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
.\" All rights reserved.
@@ -37,11 +37,12 @@
.Sh DESCRIPTION
This file describes how the router advertisement packets must be constructed
for each of the interfaces.
+.Pp
As described in
.Xr rtadvd 8 ,
you do not have to set this configuration file up at all,
unless you need some special configurations.
-You may even omit to create this file.
+You may even omit the file as a whole.
In such cases, the
.Nm rtadvd
daemon will automatically configure itself using default values
@@ -151,8 +152,10 @@ betwen routers on the link
This value is used in consistency check for locally-configured and
advertised prefix lifetimes, and has its meaning when the local router
configures a prefix on the link with a lifetime that decrements in
-real time. If the value is 0, it means the consistency check will be skipped
-for such prefixes. The default value is 0.
+real time.
+If the value is 0, it means the consistency check will be skipped
+for such prefixes.
+The default value is 0.
.It Cm \&addrs
(num) Number of prefixes.
Its default is 0, so it must explicitly be set to positve values
@@ -200,14 +203,14 @@ is more than 0.
.It Cm \&vltime
(num) Valid lifetime field
.Pq unit: seconds .
-The default value is 2592000(30 days).
+The default value is 2592000 (30 days).
.It Cm \&vltimedecr
(bool) This item means the advertised valid lifetime will decrements
in real time, which is disabled by default.
.It Cm \&pltime
(num) Preferred lifetime field
.Pq unit: seconds .
-The default value is 604800(7 days).
+The default value is 604800 (7 days).
.It Cm \&pltimedecr
(bool) This item means the advertised preferred lifetime will decrements
in real time, which is disabled by default.
@@ -258,35 +261,44 @@ See
.Xr termcap 5
for details on the capability.
.Sh EXAMPLES
+As presented above, all of the advertised parameters have default values
+defined in specifications, and hence you usually do not have to set them
+by hand, unless you need special non-default values.
+It can cause interoperability problem if you use an ill-configured
+parameter.
+.Pp
+To override a configuration parameter, you can specify the parameter alone.
+With the following configuration,
+.Xr rtadvd 8
+overrides the router lifetime parameter for the
+.Li ne0
+interface.
+.Bd -literal -offset
+ne0:\\
+ :rltime#0:
+.Ed
+.Pp
+The following example manually configures prefixes advertised from the
+.Li ef0
+interface.
+The configuration must be used with the
+.Fl s
+option to
+.Xr rtadvd 8 .
+.Bd -literal -offset
+ef0:\\
+ :addrs#1:addr="3ffe:501:ffff:1000::":prefixlen#64:
+.Ed
+.Pp
+The following example presents the default values in an explicit manner.
+The configuration is provided just for reference purposes;
+YOU DO NOT NEED TO HAVE IT AT ALL.
.Bd -literal -offset
-#
-# common definitions.
-#
-# Note: All of the following parameters have default values defined
-# in specifications, and hence you usually do not have to set them
-# by hand unless you need special non-default values.
-#
-# You even do not need to create the configuration file. rtadvd
-# would usually work well without a configuration file.
-# See also: rtadvd(8)
-
-#default:\\
-# :chlim#64:raflags#0:rltime#1800:rtime#30000:retrans#1000:\\
-# :pinfoflags#192:vltime#3600000:pltime#3600000:mtu#1500:
-#ether:\\
-# :mtu#1500:tc=default:
-
-# per-interface definitions.
-# Mainly IPv6 prefixes are configured in this part. However, rtadvd
-# automatically learns appropriate prefixes from the kernel's routing
-# table, and advertises the prefixes, so you don't have to configure
-# this part, either.
-# If you don't want the automatic advertisement, invoke rtadvd with
-# the -s option and configure this part by hand.
-
-#ef0:\\
-# :addrs#1:addr="3ffe:501:4819:1000::":prefixlen#64:tc=ether:
-
+default:\\
+ :chlim#64:raflags#0:rltime#1800:rtime#0:retrans#0:\\
+ :pinfoflags#192:vltime#2592000:pltime#604800:mtu#0:
+ef0:\\
+ :addrs#1:addr="3ffe:501:ffff:1000::":prefixlen#64:tc=default:
.Ed
.Sh SEE ALSO
.Xr termcap 5 ,