bin/165384: [PATCH] Add option to suppress RA prefix info

Craig Leres leres at
Wed Feb 22 04:20:14 UTC 2012

>Number:         165384
>Category:       bin
>Synopsis:       [PATCH] Add option to suppress RA prefix info
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 22 04:20:11 UTC 2012
>Originator:     Craig Leres
>Release:        FreeBSD 8.2-RELEASE amd64
Lawrence Berkeley National Laboratory
    FreeBSD 8.2-RELEASE FreeBSD 8.2-RELEASE #11 r43: Tue Oct 4 13:18:06 PDT 2011 leres at amd64

	To create a stateful IPv6 DHCP environment, routing
	advertisement messages must set the "managed" flag, may
	optionally set the "other stateful" flag and must not include
	any prefix information; including prefix information in
	router advertisemessages explicitly allows clients to use
	stateless address autoconfiguration.

	rtadvd does not provide a configuration option to suppress
	prefix info. If you do not explicitly specify one or more
	"addr" options, rtadvd automatically discovers prefixes by
	iterating over the interfaces.

	The attached patches add a "noprefix" option to rtadvd.conf.

--- patch-config.c begins here ---
Index: config.c
--- config.c	(revision 43)
+++ config.c	(working copy)
@@ -283,6 +283,13 @@
 		if (addr == NULL)
+		if (agetflag("noprefix")) {
+			syslog(LOG_ERR,
+			    "noprefix is set but addr is set (%s); ignoring",
+			    addr);
+			continue;
+		}
 		/* allocate memory to store prefix information */
 		if ((pfx = malloc(sizeof(struct prefix))) == NULL) {
@@ -381,7 +388,7 @@
 				now.tv_sec + pfx->preflifetime;
-	if (tmp->pfxs == 0)
+	if (tmp->pfxs == 0 && !agetflag("noprefix"))
 	MAYHAVE(val, "mtu", 0);
--- patch-config.c ends here ---

--- patch-rtadvd.conf.5 begins here ---
Index: rtadvd.conf.5
--- rtadvd.conf.5	(revision 43)
+++ rtadvd.conf.5	(working copy)
@@ -172,7 +172,10 @@
 The following items are for ICMPv6 prefix information option,
-which will be attached to router advertisement header.
+which will be attached to router advertisement header
+unless the 
+.Cm noprefix
+option is specified.
 These items can be omitted, then
 .Nm rtadvd
 will automatically get appropriate prefixes from the kernel's routing table,
@@ -183,6 +186,8 @@
 .Dq Li prefix2 ,
 to specify multiple prefixes.
 .Bl -tag -width indent
+.It Cm \&noprefix
+(bool) Suppress prefix headers.
 .It Cm \&clockskew
 (num) Time skew to adjust link propagation delays and clock skews
 between routers on the link
--- patch-rtadvd.conf.5 ends here ---


More information about the freebsd-bugs mailing list