Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

deprecate routes#N, as it is hard to keep consistency with rtprefixN.

accept any number of "rtprefix", "rtrefix0", ..., "rtprefix99".
  • Loading branch information...
commit 21dddead50b2f842007a73b20c000027629fa94f 1 parent 848afbd
itojun authored
View
49 kame/kame/rtadvd/config.c
@@ -1,4 +1,4 @@
-/* $KAME: config.c,v 1.70 2002/06/29 13:02:55 itojun Exp $ */
+/* $KAME: config.c,v 1.71 2002/06/29 13:11:45 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -421,36 +421,11 @@ getconfig(intface)
}
/* route information */
-#ifndef ROUTEINFO
- MAYHAVE(val, "routes", -1);
- if (val != -1)
- syslog(LOG_INFO, "route information option is not available");
-#else
- MAYHAVE(val, "routes", 0);
- if (val < 0 || val > 0xffffffff) {
- /* does this check is really necessary? (jinmei) */
- syslog(LOG_ERR,
- "<%s> number of route (%ld) on %s information improper",
- __func__, val, intface);
- exit(1);
- }
- tmp->routes = val;
- for (i = 0; i < tmp->routes; i++) {
+#ifdef ROUTEINFO
+ tmp->routes = 0;
+ for (i = -1; i < MAXROUTE; i++) {
struct rtinfo *rti;
char entbuf[256], oentbuf[256];
- int added = (tmp->routes > 1) ? 1 : 0;
-
- /* allocate memory to store prefix information */
- if ((rti = malloc(sizeof(struct rtinfo))) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't allocate enough memory",
- __func__);
- exit(1);
- }
- memset(rti, 0, sizeof(*rti));
-
- /* link into chain */
- insque(rti, &tmp->route);
makeentry(entbuf, sizeof(entbuf), i, "rtprefix");
addr = (char *)agetstr(entbuf, &bp);
@@ -462,12 +437,22 @@ getconfig(intface)
oentbuf, entbuf);
}
}
- if (addr == NULL) {
+ if (addr == NULL)
+ continue;
+
+ /* allocate memory to store prefix information */
+ if ((rti = malloc(sizeof(struct rtinfo))) == NULL) {
syslog(LOG_ERR,
- "<%s> need %s as a route for interface %s",
- __func__, entbuf, intface);
+ "<%s> can't allocate enough memory",
+ __func__);
exit(1);
}
+ memset(rti, 0, sizeof(*rti));
+
+ /* link into chain */
+ insque(rti, &tmp->route);
+ tmp->routes++;
+
if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) {
syslog(LOG_ERR, "<%s> inet_pton failed for %s",
__func__, addr);
View
3  kame/kame/rtadvd/config.h
@@ -1,4 +1,4 @@
-/* $KAME: config.h,v 1.5 2002/06/29 13:02:55 itojun Exp $ */
+/* $KAME: config.h,v 1.6 2002/06/29 13:11:45 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
@@ -41,3 +41,4 @@ extern void make_packet __P((struct rainfo *));
* so it should be okay to limit it
*/
#define MAXPREFIX 100
+#define MAXROUTE 100
View
41 kame/kame/rtadvd/rtadvd.conf.5
@@ -1,4 +1,4 @@
-.\" $KAME: rtadvd.conf.5,v 1.42 2002/06/29 13:02:55 itojun Exp $
+.\" $KAME: rtadvd.conf.5,v 1.43 2002/06/29 13:11:45 itojun Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
.\" All rights reserved.
@@ -276,30 +276,10 @@ explicitly.
The following items are for ICMPv6 route information option,
which will be attached to router advertisement header.
These items are optional.
-In the following list, each keyword beginning with
-.Dq rt
-could be replaced with the one beginning with
-.Dq rtr
-for compatibility reason.
-For example,
-.Cm rtrplen
-is accepted instead of
-.Cm rtplen .
-However, the former type of keywords has basically been obsoleted,
-and should not be used any more.
+Each items can be augmented with number, like
+.Dq Li rtplen2 ,
+to specify multiple routes.
.Bl -tag -width indent
-.It Cm \&routes
-(num) Number of routes.
-Its default is 0, so it must explicitly be set to positve values
-if you want to specify any route information option.
-If its value is 0, no route information is sent.
-If its value is more than 1, you must specify the index of the routes
-for each item below.
-Indices vary from 0 to N-1, where N is the
-value of
-.Cm routes.
-Each index shall follow the name of each item, e.g.,
-.Dq rtplen2 .
.It Cm \&rtprefix
(str) The prefix filled into the Prefix field of route information option.
Since
@@ -340,6 +320,19 @@ as the default value in such a case, just for compatibility with an
old version of the program.
.El
.Pp
+In the above list, each keyword beginning with
+.Dq Li rt
+could be replaced with the one beginning with
+.Dq Li rtr
+for backward compatibility reason.
+For example,
+.Cm rtrplen
+is accepted instead of
+.Cm rtplen .
+However, keywords that start with
+.Dq Li rtr
+have basically been obsoleted, and should not be used any more.
+.Pp
You can also refer one line from another by using
.Cm tc
capability.
Please sign in to comment.
Something went wrong with that request. Please try again.