summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2011-06-04 17:22:43 +0000
committerhrs <hrs@FreeBSD.org>2011-06-04 17:22:43 +0000
commit5c9df5231393cd0ff36163efaf9a64e80487b679 (patch)
tree798655b64b64068ad384cae66bc9338f4d583374 /usr.sbin/rtadvd
parent6bc38bb7763f3a319af31dd1c98897607c49bda8 (diff)
downloadFreeBSD-src-5c9df5231393cd0ff36163efaf9a64e80487b679.zip
FreeBSD-src-5c9df5231393cd0ff36163efaf9a64e80487b679.tar.gz
"noonlinkprefix" directive has been added. This disables gathering on-link
prefixes from the kernel's routing table. A rtadvd.conf with "noonlinkprefix" + no "addr" generates an RA message with no prefix information option. PR: bin/152458
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r--usr.sbin/rtadvd/config.c8
-rw-r--r--usr.sbin/rtadvd/rtadvd.conf.517
-rw-r--r--usr.sbin/rtadvd/rtadvd.h1
3 files changed, 24 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index f78c29d..e6411ed 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -185,6 +185,12 @@ getconfig(char *intface)
if ((forwarding = getinet6sysctl(IPV6CTL_FORWARDING)) < 0)
exit(1);
+ /* gather on-link prefixes from the kernel or not. */
+ if (agetflag("noonlinkprefix"))
+ rai->rai_advonlinkprefix = 0;
+ else
+ rai->rai_advonlinkprefix = 1;
+
/* get interface information */
if (agetflag("nolladdr"))
rai->rai_advlinkopt = 0;
@@ -433,7 +439,7 @@ getconfig(char *intface)
now.tv_sec + pfx->pfx_preflifetime;
}
}
- if (rai->rai_pfxs == 0)
+ if (rai->rai_advonlinkprefix && rai->rai_pfxs == 0)
get_prefix(rai);
MAYHAVE(val, "mtu", 0);
diff --git a/usr.sbin/rtadvd/rtadvd.conf.5 b/usr.sbin/rtadvd/rtadvd.conf.5
index dee1b10..ed127df 100644
--- a/usr.sbin/rtadvd/rtadvd.conf.5
+++ b/usr.sbin/rtadvd/rtadvd.conf.5
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 28, 2011
+.Dd June 4, 2011
.Dt RTADVD.CONF 5
.Os
.Sh NAME
@@ -179,10 +179,25 @@ will automatically get appropriate prefixes from the kernel's routing table,
and advertise the prefixes with the default parameters.
Keywords other than
.Cm clockskew
+and
+.Cm noonlinkprefix
can be augmented with a number, like
.Dq Li prefix2 ,
to specify multiple prefixes.
.Bl -tag -width indent
+.It Cm \&noonlinkprefix
+(bool) Specifies no prefix in the kernel will be advertised.
+By default
+.Nm rtadvd
+automatically obtains valid and on-link prefixes from the kernel's routing
+table.
+The
+.Cm noonlinkprefix
+disables that behavior.
+If this is specified and no
+.Cm addr
+keyword is specified, no prefix information option will be included in the
+message.
.It Cm \&clockskew
(num) Time skew to adjust link propagation delays and clock skews
between routers on the link
diff --git a/usr.sbin/rtadvd/rtadvd.h b/usr.sbin/rtadvd/rtadvd.h
index 730d99b..e408690 100644
--- a/usr.sbin/rtadvd/rtadvd.h
+++ b/usr.sbin/rtadvd/rtadvd.h
@@ -185,6 +185,7 @@ struct rainfo {
/* interface information */
int rai_ifindex;
int rai_advlinkopt; /* bool: whether include link-layer addr opt */
+ int rai_advonlinkprefix; /* bool: gather on-link prefixes? */
struct sockaddr_dl *rai_sdl;
char rai_ifname[IFNAMSIZ];
u_int32_t rai_phymtu; /* mtu of the physical interface */
OpenPOWER on IntegriCloud