From bicknell@ussenterprise.ufp.org  Sun Jan  7 12:09:13 2001
Return-Path: <bicknell@ussenterprise.ufp.org>
Received: from ussenterprise.ufp.org (unknown [209.249.106.101])
	by hub.freebsd.org (Postfix) with ESMTP id E43FE37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Jan 2001 12:09:12 -0800 (PST)
Received: (from root@localhost)
	by ussenterprise.ufp.org (8.11.1/8.11.1) id f07K9AB01844;
	Sun, 7 Jan 2001 15:09:10 -0500 (EST)
	(envelope-from bicknell)
Message-Id: <200101072009.f07K9AB01844@ussenterprise.ufp.org>
Date: Sun, 7 Jan 2001 15:09:10 -0500 (EST)
From: bicknell@ufp.org
Sender: bicknell@ussenterprise.ufp.org
Reply-To: bicknell@ufp.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: rc.network6 assumes single ipv6 interface is always the first interface
X-Send-Pr-Version: 3.2

>Number:         24130
>Category:       conf
>Synopsis:       rc.network6 assumes single ipv6 interface is always the first interface
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 07 12:10:01 PST 2001
>Closed-Date:    Wed Jan 10 02:34:32 PST 2001
>Last-Modified:  Wed Jan 10 02:37:16 PST 2001
>Originator:     Leo Bicknell
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
United Federation of Planets
>Environment:

	FreeBSD 4.2 compiled with IPv6 support.

>Description:

	IPv6 end hosts are only allowed to autoconfigure a single interface,
as autoconfiguring multiple interfaces may result in network reachability issues.
This is correctly documented in /etc/rc.network6.  However, the code in 
/etc/rc.network6 assumes that an autoconfiguring host _has only one NIC_, which
is not a correct assumption.

	In my enviornment, the IPv6 network is separate from the IPv4 network.
As such the machine has two NIC's, one for IPv4 _only_, and one for IPv6 _only_.
The IPv6 NIC is the second NIC in the box (fxp1).  This does not violate the
rule of having a single NIC for IPv6 autoconfiguration, but is not an allowed
configuration by the current /etc/rc.network6 script.

>How-To-Repeat:

	Configure a box with two nics (the examples below assume fxp0 and fxp1).
Try the following /etc/rc.conf config lines:


network_interfaces="fxp0 lo0"
ifconfig_fxp0="inet 209.249.106.101 netmask 255.255.255.240"
defaultrouter="209.249.106.97"
ipv6_enable="YES"
ipv6_network_interfaces="fxp1"

	Due to the following code in /etc/rc.network6:

                        #
                        # manual configurations - in case ip6_gateway_enable=NO
                        # you can configure only single interface,
                        # as specification assumes that
                        # autoconfigured host has single interface only.
                        #
                        set `ifconfig -l`
                        ipv6_network_interfaces="$1"

	The code will override the ipv6_network_interfaces="fxp1" with 
ipv6_network_interfaces="fxp0" (the first interface in the box) in these
lines.

	Note, it is unclear if ipv6_network_interfaces="fxp1" should really
be ipv6_network_interfaces="fxp1 lo0", which makes more sense.  The code does
not seem to allow for this possibility either.

>Fix:

	A simple hack would be to change set `ifconfig -l` to be 
set $ipv6_network_interfaces, allowing the second line to get the first
specified interface, if more than one were specified.  I believe more
elaborte checking might be in order though, to allow lo0 to be configured
as well, and to produce better warning / error messages.


>Release-Note:
>Audit-Trail:

From: David Malone <dwmalone@maths.tcd.ie>
To: bicknell@ufp.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/24130: rc.network6 assumes single ipv6 interface is always the first interface
Date: Sun, 7 Jan 2001 23:00:02 +0000

 On Sun, Jan 07, 2001 at 03:09:10PM -0500, bicknell@ufp.org wrote:
 
 > ipv6_network_interfaces="fxp1"
 > 
 > 	Due to the following code in /etc/rc.network6:
 > 
 >                         #
 >                         # manual configurations - in case ip6_gateway_enable=NO
 >                         # you can configure only single interface,
 >                         # as specification assumes that
 >                         # autoconfigured host has single interface only.
 >                         #
 >                         set `ifconfig -l`
 >                         ipv6_network_interfaces="$1"
 > 
 > 	The code will override the ipv6_network_interfaces="fxp1" with 
 > ipv6_network_interfaces="fxp0" (the first interface in the box) in these
 > lines.
 
 The code quote above is only run if you have ipv6_network_interfaces
 set to auto. Since you are setting this variable to fxp1 it should
 not be run. Maybe you are seeing some other configuration problem?
 
 	David.
 

From: David Malone <dwmalone@maths.tcd.ie>
To: bicknell@ufp.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/24130: rc.network6 assumes single ipv6 interface is always the first interface
Date: Sun, 7 Jan 2001 23:08:21 +0000

 On Sun, Jan 07, 2001 at 03:09:10PM -0500, bicknell@ufp.org wrote:
 
 [Sorry if you get this twice - I think my first reply got eaten.]
 
 > ipv6_network_interfaces="fxp1"
 > 
 > 	Due to the following code in /etc/rc.network6:
 > 
 >                         #
 >                         # manual configurations - in case ip6_gateway_enable=NO
 >                         # you can configure only single interface,
 >                         # as specification assumes that
 >                         # autoconfigured host has single interface only.
 >                         #
 >                         set `ifconfig -l`
 >                         ipv6_network_interfaces="$1"
 > 
 > 	The code will override the ipv6_network_interfaces="fxp1" with 
 > ipv6_network_interfaces="fxp0" (the first interface in the box) in these
 > lines.
 
 Note - the code you quote is only run if ipv6_network_interfaces
 is set to auto. If you are setting ipv6_network_interfaces to fxp1
 then you shouldn't have any other interfaces configured (though
 you might want to add lo0 to the list for the sake of completeness).
 
 	David.
 

From: Leo Bicknell <bicknell@ufp.org>
To: David Malone <dwmalone@maths.tcd.ie>
Cc: bicknell@ufp.org, FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/24130: rc.network6 assumes single ipv6 interface is always the first interface
Date: Sun, 7 Jan 2001 18:25:31 -0500

 On Sun, Jan 07, 2001 at 11:00:02PM +0000, David Malone wrote:
 > The code quote above is only run if you have ipv6_network_interfaces
 > set to auto. Since you are setting this variable to fxp1 it should
 > not be run. Maybe you are seeing some other configuration problem?
 
 	You're right, I didn't pay close enough attention.
 
 	I'm working on troubleshooting now to find the exact cause
 of the problem, but notice something interesting already.  If I set
 ipv6_enable="NO", fxp0 still gets an ipv6 link local address.  I 
 then removed /etc/rc.network6 (actually, made it a one line empty
 script) and tried again (with ipv6_enable="NO"), and I still get a 
 link local address on fxp0 (not on fxp1 though).  
 
 	Is this intended?
 
 -- 
 Leo Bicknell - bicknell@ufp.org
 Systems Engineer - Internetworking Engineer - CCIE 3440
 Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org
 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Wed Jan 10 02:34:32 PST 2001 
State-Changed-Why:  
Submitter is going to send in some PRs to supersede this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24130 
>Unformatted:
