From hsn@netmag.cz  Mon Aug 28 13:46:39 2006
Return-Path: <hsn@netmag.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8550A16A500
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 13:46:39 +0000 (UTC)
	(envelope-from hsn@netmag.cz)
Received: from smtp-out3.iol.cz (smtp-out3.iol.cz [194.228.2.91])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9586A43D49
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 13:46:38 +0000 (GMT)
	(envelope-from hsn@netmag.cz)
Received: from antivir3.iol.cz (antivir3.iplanet.iol.cz [192.168.30.206])
	by smtp-out3.iol.cz (Postfix) with ESMTP id 1119621F6B7
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 15:44:32 +0200 (CEST)
Received: from localhost (antivir3.iol.cz [127.0.0.1])
	by antivir3.iol.cz (Postfix) with ESMTP id 00A8142000C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 15:44:32 +0200 (CEST)
Received: from smtp-out3.iol.cz (smtp-out-3.iplanet.iol.cz [192.168.30.28])
	by antivir3.iol.cz (Postfix) with ESMTP id E1CFF420006
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 15:44:31 +0200 (CEST)
Received: from sanatana.dharma (96.219.broadband3.iol.cz [85.70.219.96])
	by smtp-out3.iol.cz (Postfix) with ESMTP id 60C6B57E81
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Aug 2006 15:44:30 +0200 (CEST)
Received: from hsn@localhost
	by sanatana.dharma (Exim 4.63_0 FreeBSD) id 1GHhPg-00056N-Vm
	; Mon, 28 Aug 2006 15:44:29 +0200
Message-Id: <E1GHhPg-00056N-Vm@sanatana.dharma>
Date: Mon, 28 Aug 2006 15:44:28 +0200
From: Radim Kolar <hsn@netmag.cz>
Reply-To: Radim Kolar <hsn@netmag.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: hsn@netmag.cz
Subject: [if_bridge] don't generate random L2 address
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         102607
>Category:       kern
>Synopsis:       [if_bridge] don't generate random L2 address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thompsa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 28 13:50:19 GMT 2006
>Closed-Date:    Thu Oct 12 00:24:04 GMT 2006
>Last-Modified:  Thu Oct 12 00:24:04 GMT 2006
>Originator:     Radim Kolar
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
sd
>Environment:
System: FreeBSD sanatana.dharma 6.1-STABLE FreeBSD 6.1-STABLE #3: Fri Aug 25 12:13:08 CEST 2006 root@sanatana.dharma:/usr/obj/usr/src/sys/UP i386
>Description:
if_bridge interfaces have every boottime different L2 address. This behaviour
is very different from other interfaces like network cards, they have L2
address in EPROMS. Because bridge interface is designed to look and work like
other NIC cards, it should have static L2 address by default to make work of
network admins easier, other BSDs complains about inet address moved and
you can't use static IP in dhcpd.

Because not every number can be used as L2 address for bridge, admin can make
hard-to-find mistake when configuring static address by hand.
>How-To-Repeat:
	
>Fix:
        1. change kernel code or  to generate static IP address
	for bridge interface from attached member interfaces.
	     or
	2. use startup scripts to generate random number and
	   store it somewhere in /var.
             or
	3. Make system complain/warning if you set bridge0 to broadcast
	   address.
	     or
        4. Document in if_bridge(4) that L2 address is random and document
	   correct format of ethernet addresses.

	Problem with 1. is that address will change if you add or swap NICs
	in bridge, but it is still less likely to change than using random
	numbers now.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Mon Aug 28 18:18:21 UTC 2006 
Responsible-Changed-Why:  
Pass over to freebsd-net for discussion on the best way to handle this. 

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

From: Stefan Bethke <stb@lassitu.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/102607: [if_bridge] don't generate random L2 address
Date: Sun, 3 Sep 2006 01:09:16 +0200

 Here's my suggestion for an addition to if_bridge(4):
 
 --- if_bridge.4.orig    Sun Aug 13 20:44:18 2006
 +++ if_bridge.4 Fri Sep  1 18:53:19 2006
 @@ -107,6 +107,13 @@
 in
 .Xr rc.conf 5 .
 .Pp
 +The
 +.Nm
 +interface randomly chooses a link (MAC) address in the range  
 reserved for
 +locally adminstered addresses when it is created.
 +The address can be changed by assigning the desired link address using
 +.Xr ifconfig 8 .
 +.Pp
 The MTU of the first member interface to be added is used as the  
 bridge MTU.
 All additional members are required to have exactly the same value.
 .Pp
 @@ -231,6 +238,16 @@
       addm fxp6 stp fxp6 \e
       addm fxp7 stp fxp7 \e
       up
 +.Ed
 +.Pp
 +The bridge can be used as a regular host interface at the same time as
 +bridging between it's member ports. In this example, the bridge  
 connects em0
 +and em1, and will receive it's IP address through DHCP:
 +.Bd -literal -offset indent
 +cloned_interfaces="bridge0"
 +ifconfig_bridge0="link 12:34:56:78:9a:bc addm em0 addm em0 DHCP"
 +ifconfig_em0="up"
 +ifconfig_em1="up"
 .Ed
 .Pp
 The bridge can tunnel Ethernet across an IP internet using the EtherIP
 

From: Stefan Bethke <stb@lassitu.de>
To: bug-followup@FreeBSD.org, Radim Kolar <hsn@netmag.cz>
Cc:  
Subject: Re: kern/102607: [if_bridge] don't generate random L2 address
Date: Sun, 3 Sep 2006 13:40:05 +0200

 The example obviously should read
 
 ifconfig_bridge0="link 12:34:56:78:9a:bc addm em0 addm em1 DHCP"
 
 Thanks Radim for pointing this out.
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Sun Oct 8 19:42:02 UTC 2006 
State-Changed-Why:  
Committed. I decided not to include the link address in the example 
as it shouldnt need to be set in the default case. 


Responsible-Changed-From-To: freebsd-net->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Sun Oct 8 19:42:02 UTC 2006 
Responsible-Changed-Why:  
Committed. I decided not to include the link address in the example 
as it shouldnt need to be set in the default case. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/102607: commit references a PR
Date: Sun,  8 Oct 2006 19:41:23 +0000 (UTC)

 thompsa     2006-10-08 19:41:05 UTC
 
   FreeBSD src repository
 
   Modified files:
     share/man/man4       if_bridge.4 
   Log:
   - Note that the bridge uses a random MAC and can be overridden.
   - Provide an example of assigning an IP to the bridge.
   
   PR:             kern/102607
   Submitted by:   Stefan Bethke <stb@lassitu.de>
   MFC after:      3 days
   
   Revision  Changes    Path
   1.22      +18 -0     src/share/man/man4/if_bridge.4
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: thompsa 
State-Changed-When: Thu Oct 12 00:23:46 UTC 2006 
State-Changed-Why:  
MFC complete. 

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