From nobody@FreeBSD.org  Tue Jul 25 06:44:18 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3347B16A4DD
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Jul 2006 06:44:18 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0724543D49
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Jul 2006 06:44:18 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k6P6iHjg093101
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Jul 2006 06:44:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k6P6iHDj093100;
	Tue, 25 Jul 2006 06:44:17 GMT
	(envelope-from nobody)
Message-Id: <200607250644.k6P6iHDj093100@www.freebsd.org>
Date: Tue, 25 Jul 2006 06:44:17 GMT
From: Tomas Podermanski <tpoder@cis.vutbr.cz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.conf scripts don't create vlan interfaces
X-Send-Pr-Version: www-2.3

>Number:         100799
>Category:       conf
>Synopsis:       rc.conf scripts don't create vlan interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 25 06:50:10 GMT 2006
>Closed-Date:    Tue Jul 25 19:29:44 GMT 2006
>Last-Modified:  Tue Jul 25 19:29:44 GMT 2006
>Originator:     Tomas Podermanski
>Release:        6.1
>Organization:
Brno university of technology
>Environment:
FreeBSD dev61.cis.vutbr.cz 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Thu Jun  1 15:14:04 CEST 2006     root@dev61.cis.vutbr.cz:/usr/src/sys/i386/compile/SERVER  i386
>Description:
When I have vlan interfaces configured in rc.conf scripts them vlan interfaces are not create during system startup.
>How-To-Repeat:
Create line 

ifconfig_vlan0="147.229.241.1/24 vlan 589 vlandev bge0"

in /etc/rc.conf
>Fix:
script /etc/rc.d/mkvlan with follow content:

#!/bin/sh
#
# PROVIDE: mkvlan
# BEFORE: netif
# KEYWORD: nojail

. /etc/rc.subr
. /etc/network.subr

name="mkvlan"
rcvar=`set_rcvar`
start_cmd="mkvlan_start"
stop_cmd="mkvlan_stop"

mkvlan_start()
{
        echo -n "creating vlan interfaces... "
        set | grep "ifconfig_vlan[0-9]*=" | while read ln ; do
                ifn=`expr "${ln}" : "ifconfig_\(vlan[0-9]*\)=.*"`
                echo -n "${ifn} "
                ifconfig $ifn create
        done
        echo
}

mkvlan_stop()
{
}

load_rc_config $name
run_rc_command "$1"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jul 25 09:09:47 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 
State-Changed-From-To: open->feedback 
State-Changed-By: yar 
State-Changed-When: Tue Jul 25 11:12:18 UTC 2006 
State-Changed-Why:  
There is an rc.conf variable named "cloned_interfaces" that 
should list all network interfaces to create.  That is, 
you also need the following line in your rc.conf: 

cloned_interfaces="vlan0" 

This approach has proved more reliable than scanning all shell 
variable names for the ^ifconfig_ pattern. 

I believe that cloned_interfaces is documented on rc.conf(5). 

May I close this PR now? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 
Responsible-Changed-From-To: freebsd-rc->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Tue Jul 25 11:18:13 UTC 2006 
Responsible-Changed-Why:  
/me handling this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Tomas Podermanski <tpoder@cis.vutbr.cz>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/100799: rc.conf scripts don't create vlan interfaces
Date: Tue, 25 Jul 2006 10:14:50 -0500

 Please describe your setup.  Plenty of people are creating and
 configuring vlan interfaces via the current scripts.  The one gotcha at
 this point is that while you can create <etherif>.<trunk> style
 interfaces you can't configure them in 6.x because I haven't MFC'd the
 changes required.
 
 -- Brooks
State-Changed-From-To: feedback->closed 
State-Changed-By: yar 
State-Changed-When: Tue Jul 25 19:28:26 UTC 2006 
State-Changed-Why:  
Tomas likes the existing approach of cloned_interfaces. 

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