From nobody@FreeBSD.org  Thu Dec 21 19:21:07 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 578A716A407
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Dec 2006 19:21:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 4832913C447
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Dec 2006 19:21:07 +0000 (UTC)
	(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 kBLJL78k035061
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Dec 2006 19:21:07 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBLJL6nh035060;
	Thu, 21 Dec 2006 19:21:06 GMT
	(envelope-from nobody)
Message-Id: <200612211921.kBLJL6nh035060@www.freebsd.org>
Date: Thu, 21 Dec 2006 19:21:06 GMT
From: Daniel Mafua<mafua@dempseyuniform.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bridge interface given in rc.conf not taking an (static) IP address
X-Send-Pr-Version: www-3.0

>Number:         107035
>Category:       conf
>Synopsis:       [patch] bridge(8): bridge interface given in rc.conf not taking an (static) IP address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 21 19:30:10 GMT 2006
>Closed-Date:    
>Last-Modified:  Thu Mar 19 04:22:48 UTC 2009
>Originator:     Daniel Mafua
>Release:        6.2-RC1
>Organization:
Dempsey Uniform & Linen
>Environment:
FreeBSD birfrost.scythe.net 6.2-RC1 FreeBSD 6.2-RC1 #0: Wed Dec 20 12:35:15 EST 2006     /usr/src/sys/i386/compile/newkern  i386
>Description:
A bridge defined in rc.conf does not take a static IP address.  According to the man page for if_bridge a bridge is created using cloned_interfaces. It is then configured using ifconfig_{bridgename}="whatever".  The documentation example in the man page says: 

cloned_interfaces="bridge0"
ifconfig_bridge0="addm em0 addm em1 DHCP"

Assuming that you were going to add a static IP address for the bridge that would be:

ifconfig_bridge0="addm em0 addm em1 inet 10.0.0.1 netmask 255.0.0.0"

This however does not work.  The bridge is created with child interfaces correctly, but an IP address is not assigned to the bridge interface.  This creates problems during startup as many services need to bind to an IP.  The workaround is to make your own RC script and assign it there.  

If there is another way to do this, it should be documented.
>How-To-Repeat:
Attempt to create static ip address on bridged interface during bootup.  See rc.conf example above.
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Dec 21 19:31:42 UTC 2006 
Responsible-Changed-Why:  
reassign to rc. 

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

From: Andrew Thompson <thompsa@freebsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/107035: bridge interface given in rc.conf not taking an (static) IP address
Date: Fri, 5 Jan 2007 20:22:21 +1300

 Hi,
 
 It would be interesting to see if it worked with a different order of
 the arguments, please try with:
 
  ifconfig_bridge0="inet 10.0.0.1 netmask 255.0.0.0 addm em0 addm em1"
 
 
 cheers,
 Andrew

From: Charles KOPROWSKI <juan@klipix.org>
To: bug-followup@FreeBSD.org,  mafua@dempseyuniform.com
Cc:  
Subject: Re: conf/107035: bridge interface given in rc.conf not taking an
 (static) IP address
Date: Tue, 27 Feb 2007 09:21:00 +0100

 Hi,
 
 I had the same problem setting up a bridge with static ip address. I 
 tried with a different order of arguments as it was sugested by Andrew 
 and it worked.
 
 Here's my /etc/rc.conf:
 ifconfig_vr0="up"
 ifconfig_dc0="up"
 cloned_interfaces="bridge0"
 ifconfig_bridge0="inet 10.0.1.10 netmask 255.255.255.0 addm vr0 addm dc0"
 
 cheers
 
 
Responsible-Changed-From-To: freebsd-rc->freebsd-net 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Tue Feb 27 08:58:47 UTC 2007 
Responsible-Changed-Why:  
This is a limitation of ifconfig rather than rc. The ip address 
needs to be the first argument, why is this so? 


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

Date: Mon, 16 Apr 2007 23:26:30 +0930
From: Benjamin Close <Benjamin.Close@clearchain.com>

 Looking into this it appears it's because ifconfig is attempting to set 
 the destination address on the interface rather than the interface address.
 The below patch fixes the problem with the bridge interface allowing:

 ifconfig bridge0 addm em0 addm fwe0 inet 10.0.0.1 netmask 255.255.255.0

 to work - though I'm sure it breaks other things.

 Cheers,
     Benjamin

 Index: ifconfig.c
 ===================================================================
 RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.c,v
 retrieving revision 1.113.2.5
 diff -u -r1.113.2.5 ifconfig.c
 --- ifconfig.c	18 Mar 2006 21:59:22 -0000	1.113.2.5
 +++ ifconfig.c	16 Apr 2007 13:26:35 -0000
 @@ -504,7 +504,7 @@
  			 * Not a recognized command, choose between setting
  			 * the interface address and the dst address.
  			 */
 -			p = (setaddr ? &setifdstaddr_cmd : &setifaddr_cmd);
 +			p = (setaddr ? &setifaddr_cmd : &setifdstaddr_cmd);
  		}
  		if (p->c_u.c_func || p->c_u.c_func2) {
  			if (p->c_parameter == NEXTARG) {
 
>Unformatted:
