From hsn@netmag.cz  Mon Aug 21 21:05:28 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 9C7BC16A4DA
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 21:05:28 +0000 (UTC)
	(envelope-from hsn@netmag.cz)
Received: from smtp-out4.iol.cz (smtp-out4.iol.cz [194.228.2.92])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E9CE643D45
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 21:05:27 +0000 (GMT)
	(envelope-from hsn@netmag.cz)
Received: from antivir4.iol.cz (avir4 [192.168.30.209])
	by smtp-out4.iol.cz (Postfix) with ESMTP id 174E21FA58F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 23:05:25 +0200 (CEST)
Received: from localhost (antivir4.iol.cz [127.0.0.1])
	by antivir4.iol.cz (Postfix) with ESMTP id EEF3424003C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 23:05:24 +0200 (CEST)
Received: from smtp-out4.iol.cz (smtp-out-4.iplanet.iol.cz [192.168.30.31])
	by antivir4.iol.cz (Postfix) with ESMTP id D54E724003B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 23:05:24 +0200 (CEST)
Received: from sanatana.dharma (96.219.broadband3.iol.cz [85.70.219.96])
	by smtp-out4.iol.cz (Postfix) with ESMTP id 9C75122AF18
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Aug 2006 23:05:24 +0200 (CEST)
Received: from hsn@localhost
	by sanatana.dharma (Exim 4.63_0 FreeBSD) id 1GFGxX-000GXH-9F
	; Mon, 21 Aug 2006 23:05:23 +0200
Message-Id: <E1GFGxX-000GXH-9F@sanatana.dharma>
Date: Mon, 21 Aug 2006 23:05:23 +0200
From: Radim Kolar <hsn@netmag.cz>
Reply-To: Radim Kolar <hsn@netmag.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: hsn@localhost.iol.cz
Subject: [if_bridge] don't forwards outgoing broadcasts to local process
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         102361
>Category:       kern
>Synopsis:       [if_bridge] don't forwards outgoing broadcasts to local process
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    thompsa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 21 21:10:16 GMT 2006
>Closed-Date:    Mon Aug 28 03:13:52 GMT 2006
>Last-Modified:  Mon Aug 28 03:13:52 GMT 2006
>Originator:     Radim Kolar
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD sanatana.dharma 6.1-STABLE FreeBSD 6.1-STABLE #2: Tue Jun 27 10:46:03 CEST 2006 root@sanatana.dharma:/usr/obj/usr/src/sys/UP i386
>Description:
When using if_bridge broadcasts generated by local process are not seen by
itself or other programs on same machine, but they are going to wire and
other computers well, broadcasts from other machines are received fine too.
>How-To-Repeat:
I recommend to use rwho/rwhod/ruptime for testing.

test machine setup. no need to have more machines for testing this case
fxp0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
      options=8<VLAN_MTU>
      inet6 fe80::2a0:c9ff:fe0f:971e%fxp0 prefixlen 64 scopeid 0x1
      ether 00:a0:c9:0f:97:1e
ed0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
      inet6 fe80::200:1ff:fe02:2056%ed0 prefixlen 64 scopeid 0x2
      ether 00:00:01:02:20:56
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
     inet6 ::1 prefixlen 128
     inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
     inet 127.0.0.1 netmask 0xff000000
     inet 127.0.0.2 netmask 0xff000000
bridge0: flags=8143<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500
     inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
     ether 0a:0f:6e:27:2d:a6
     priority 32768 hellotime 2 fwddelay 15 maxage 20
     member: ed0 flags=3<LEARNING,DISCOVER>
     member: fxp0 flags=3<LEARNING,DISCOVER>

run rwhod here
     with this retup rwho will not see its own announcements, it can see
     other machines on network but not self. You can test it with rwho
     or ruptime commands. other machines can see entire network well

sanatana# tcpdump -ni bridge0 udp
listening on bridge0, link-type EN10MB (Ethernet), capture size 96 bytes
->our broadcast IP 10.0.0.2.513 > 10.0.0.255.513: UDP, length 180
->from other pc IP 10.0.0.4.513 > 10.0.0.255.513: UDP, length 84
	
>Fix:
	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Mon Aug 21 21:15:42 UTC 2006 
Responsible-Changed-Why:  
Grab this one. 

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

From: Andrew Thompson <thompsa@freebsd.org>
To: bug-followup@FreeBSD.org, hsn@netmag.cz
Cc:  
Subject: Re: kern/102361: [if_bridge] don't forwards outgoing broadcasts to local process
Date: Fri, 25 Aug 2006 19:27:42 +1200

 Hi,
 
 
 Can you please try this simple patch.
 
 
 cheers,
 Andrew
 
 Index: if_bridge.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/net/if_bridge.c,v
 retrieving revision 1.78
 diff -u -p -r1.78 if_bridge.c
 --- if_bridge.c	17 Aug 2006 11:16:02 -0000	1.78
 +++ if_bridge.c	25 Aug 2006 06:04:03 -0000
 @@ -540,7 +540,7 @@ bridge_clone_create(struct if_clone *ifc
  
  	ifp->if_softc = sc;
  	if_initname(ifp, ifc->ifc_name, unit);
 -	ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST;
 +	ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX;
  	ifp->if_ioctl = bridge_ioctl;
  	ifp->if_start = bridge_start;
  	ifp->if_init = bridge_init;

From: Radim Kolar <hsn@netmag.cz>
To: Andrew Thompson <thompsa@freebsd.org>
Cc: bug-followup@freebsd.org, hsn@netmag.cz
Subject: Re: kern/102361: [if_bridge] don't forwards outgoing broadcasts to local process
Date: Fri, 25 Aug 2006 14:13:35 +0200

 > Can you please try this simple patch.
 patch tested and problem is solved.
 Thanks.
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Fri Aug 25 22:06:06 UTC 2006 
State-Changed-Why:  
Awaiting MFC 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102361 
State-Changed-From-To: patched->closed 
State-Changed-By: thompsa 
State-Changed-When: Mon Aug 28 03:13:12 UTC 2006 
State-Changed-Why:  
MFC complete and the fix will be part of 6.2. Thanks for the PR! 

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