NetBSD Problem Report #39236
From www@NetBSD.org Mon Jul 28 06:29:28 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 9195C63B99A
for <gnats-bugs@gnats.netbsd.org>; Mon, 28 Jul 2008 06:29:28 +0000 (UTC)
Message-Id: <20080728062927.F1EBE63B91E@narn.NetBSD.org>
Date: Mon, 28 Jul 2008 06:29:27 +0000 (UTC)
From: randolf+netbsd.org@inter-corporate.com
Reply-To: randolf+netbsd.org@inter-corporate.com
To: gnats-bugs@NetBSD.org
Subject: Network interface order problem: /etc/ifconfig.bridge* is started too early
X-Send-Pr-Version: www-1.0
>Number: 39236
>Category: kern
>Synopsis: Network interface order problem: /etc/ifconfig.bridge* is started too early
>Confidential: no
>Severity: critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jul 28 06:30:01 +0000 2008
>Last-Modified: Mon Jul 28 14:10:03 +0000 2008
>Originator: Randolf Richardson
>Release: NetBSD v4.99.70
>Organization:
Inter-Corporate Computer & Network Services, Inc.
>Environment:
NetBSD netbsd.test.lumbercartel.ca 4.99.70 NetBSD 4.99.70 (XEN3_DOM0) #0: Mon Jul 21 04:34:08 PDT 2008 builds@wb38:/home/builds/ab/HEAD/i386/200807210002Z-obj/home/builds/ab/HEAD/src/sys/arch/i386/compile/XEN3_DOM0 i386
>Description:
When I set up ifconfig.tap0 and also ifconfig.bridge0 to bridge to it, the tap0 interface hasn't started yet and so the bridge configuration fails.
My recommendation is to do one of the following:
* change the order that interfaces are initialized in so that ifconfig.bridge* comes [at least] after ifconfig.tap* (not before)
* document the order (if it's consistent) in "man ifconfig.if"
* add support for "before interface-name[, interface-name[, ...]]" and "after interface-name[, interface-name[, ...]]" directives in ifconfig.* files to allow dependencies to be configured easily
I would prefer to see the third solution implemented because it provides the most flexibility.
Thanks in advance.
>How-To-Repeat:
Here are the relevant ifconfig.* files, after implementing the work-around (describe in the "fix" section below):
netbsd# cat /etc/ifconfig.tap0
create
inet 10.88.1.1/24
!brconfig bridge0 add $int up
netbsd# cat /etc/ifconfig.bridge0
create
-----
Here are the same files that result in the failure to create the bridge:
netbsd# cat /etc/ifconfig.tap0
create
inet 10.88.1.1/24
netbsd# cat /etc/ifconfig.bridge0
create
!brconfig $int add tap0 up
>Fix:
To work-around, I have to configure the bridge in my ifconfig.tap0 file instead, which is okay but leaves me wondering if the order is clearly defined or based on other factors (e.g., the order in which the ifconfig.* files were created).
The "other factors" is the reason for setting the severity to "critical" since a reboot could leave a system without bridging, and possibly non-functional (e.g., OpenVPN is used for secure access, and without the bridge it may not be remotely accessible).
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/39236: Network interface order problem: /etc/ifconfig.bridge* is started too early
Date: Mon, 28 Jul 2008 12:47:30 +0200
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
First the easy workaround with -current means: set auto_ifconfig=NO
and set net_interfaces to the interfaces you want to configure, in the
order you prefer.
Second: the current order by default is just alphabetic.
Finaly: I like the idea to introduce optional dependencies, and implementation
should be extremely simple (like attached untested patch) by reusing
rcorder and support the same PROVIDE/REQUIRE/BEFORE/KEYWORD semantics
we use for rc script ordering. If none of those are provided in the ifconfig.*
files, the order will be returned unchanged.
Martin
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch
Index: network
===================================================================
RCS file: /cvsroot/src/etc/rc.d/network,v
retrieving revision 1.52
diff -u -r1.52 network
--- network 29 May 2008 15:38:35 -0000 1.52
+++ network 28 Jul 2008 10:42:08 -0000
@@ -191,7 +191,7 @@
tmp="$net_interfaces"
fi
echo -n 'Configuring network interfaces:'
- for int in $tmp; do
+ for int in $( rcorder $tmp ); do
eval args=\$ifconfig_$int
if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
if ifconfig $int create 2>/dev/null && \
--ibTvN161/egqYuK8--
From: Andreas Wrede <andreas@planix.com>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: kern/39236: Network interface order problem: /etc/ifconfig.bridge* is started too early
Date: Mon, 28 Jul 2008 08:49:06 -0400
See http://mail-index.netbsd.org/current-users/2008/04/20/
msg001900.html for a partial but simple solution to the interface
ordering problem.
--
aew
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.