From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 22 04:20:14 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBDD91065675 for ; Wed, 22 Feb 2012 04:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5E58FC0C for ; Wed, 22 Feb 2012 04:20:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q1M4KCP6021324 for ; Wed, 22 Feb 2012 04:20:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q1M4KCkh021322; Wed, 22 Feb 2012 04:20:12 GMT (envelope-from gnats) Resent-Date: Wed, 22 Feb 2012 04:20:12 GMT Resent-Message-Id: <201202220420.q1M4KCkh021322@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Craig Leres Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B1A106564A for ; Wed, 22 Feb 2012 04:11:28 +0000 (UTC) (envelope-from leres@ee.lbl.gov) Received: from hot.ee.lbl.gov (hot.ee.lbl.gov [IPv6:2620:83:8000:102::cb]) by mx1.freebsd.org (Postfix) with ESMTP id 5F38D8FC14 for ; Wed, 22 Feb 2012 04:11:28 +0000 (UTC) Received: from hot.ee.lbl.gov (localhost [127.0.0.1]) by hot.ee.lbl.gov (8.14.5/8.14.5) with ESMTP id q1M4BSh5071129; Tue, 21 Feb 2012 20:11:28 -0800 (PST) Received: (from leres@localhost) by hot.ee.lbl.gov (8.14.5/8.14.5/Submit) id q1M4BSsE071128; Tue, 21 Feb 2012 20:11:28 -0800 (PST) Message-Id: <201202220411.q1M4BSsE071128@hot.ee.lbl.gov> Date: Tue, 21 Feb 2012 20:11:28 -0800 (PST) From: Craig Leres To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Craig Leres Subject: bin/165384: [PATCH] Add option to suppress RA prefix info X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Craig Leres List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2012 04:20:14 -0000 >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 >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Feb 22 04:20:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Craig Leres >Release: FreeBSD 8.2-RELEASE amd64 >Organization: Lawrence Berkeley National Laboratory >Environment: FreeBSD hot.ee.lbl.gov 8.2-RELEASE FreeBSD 8.2-RELEASE #11 r43: Tue Oct 4 13:18:06 PDT 2011 leres@hot.ee.lbl.gov:/usr/src/8.2-RELEASE/sys/amd64/compile/LBLIPV6 amd64 >Description: 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. >How-To-Repeat: >Fix: 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) continue; + 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) { syslog(LOG_ERR, @@ -381,7 +388,7 @@ now.tv_sec + pfx->preflifetime; } } - if (tmp->pfxs == 0) + if (tmp->pfxs == 0 && !agetflag("noprefix")) get_prefix(tmp); 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 @@ .El .Pp 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 --- >Release-Note: >Audit-Trail: >Unformatted: