From nobody@FreeBSD.org  Wed Oct 20 17:34:27 2004
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 5EEEA16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 17:34:27 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 33D3043D2D
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 17:34:27 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9KHYQDr012044
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 17:34:26 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i9KHYQ1W012043;
	Wed, 20 Oct 2004 17:34:26 GMT
	(envelope-from nobody)
Message-Id: <200410201734.i9KHYQ1W012043@www.freebsd.org>
Date: Wed, 20 Oct 2004 17:34:26 GMT
From: "Lenar D. Tukhvatullin" <blackv@netroad.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: promisc mode on vlan interface does not work correctly
X-Send-Pr-Version: www-2.3

>Number:         72933
>Category:       kern
>Synopsis:       [netgraph] [patch] promisc mode on vlan interface does not work correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 17:40:14 GMT 2004
>Closed-Date:    Sat Jan 10 00:10:12 UTC 2009
>Last-Modified:  Sat Jan 10 00:10:12 UTC 2009
>Originator:     Lenar D. Tukhvatullin
>Release:        5.3-STABLE
>Organization:
Ulyanovsk State Technical University
>Environment:
FreeBSD xxx.com 5.3-STABLE FreeBSD 5.3-STABLE #2: Wed Oct 20 12:22:08 MSD 2004     lenar@xxx.com:/usr/obj/usr/src/sys/GENERIC  i386

FreeBSD 5.3-STABLE, RELENG_5 cvsup'ed at Oct 20 2004
>Description:
Promiscuous mode on vlan interface does not work if parent interface
supports VLAN_HWTAGGING. Probably bug in sys/net/if_ethersubr.c:650
(packet with non-parents ethernet-address is rejected by ether_demux)
>How-To-Repeat:
(bge0 supports VLAN_HW_TAGGING)

# ifconfig vlan0 create
# infconfig vlan0 vlan 1 vlandev bge0
# ifconfig bge0 up
# ifconfig vlan0 up

configure bridging beetwen vlan0 and another interface (bge1):

# ifconfig bge1 172.16.0.1 netmask 255.255.255.0
# kldload bridge
# sysctl.net.link.ether.bridge.config="vlan0 bge1"
# sysctl.net.link.ether.bridge.enable=1

log messages:
.. kernel: bge1: promiscuous mode enabled
.. kernel: bge0: promiscuous mode enabled
.. kernel: vlan0: promiscuous mode enabled

pinging host (172.16.0.2 located on bge0 side in vlan 1)

# ping 172.16.0.2
..
Host is down
Host is down

-----

tcpdump's in another console:

# tcpdump -e -i bge0

21:20:24.753738 00:08:02:91:d5:61 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 172.16
.0.2 tell 172.16.0.1

21:20:24.755528 00:11:20:11:34:c0 > 00:08:02:91:d5:61, ethertype ARP (0x0806), length 60: arp reply
172.16.0.2 is-at 00:11:20:11:34:c0

21:20:25.758096 00:08:02:91:d5:61 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 172.16
.0.2 tell 172.16.0.1

21:20:25.759672 00:11:20:11:34:c0 > 00:08:02:91:d5:61, ethertype ARP (0x0806), length 60: arp reply
172.16.0.2 is-at 00:11:20:11:34:c0

...

# tcpdump -e -i vlan0

21:22:35.649629 00:08:02:91:d5:61 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 172.16
.0.2 tell 172.16.0.1

21:22:36.650105 00:08:02:91:d5:61 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 172.16
.0.2 tell 172.16.0.1

..

-----

incoming packet on bge0 is not delivered to vlan0 interface.
>Fix:
fix sys/net/if_ethersubr.c:650 (in function ether_demux)

original:

!(ether_type == ETHERTYPE_VLAN && ifp->if_nvlans > 0)) {

fixed:

!((ether_type == ETHERTYPE_VLAN || m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL) != NULL) && ifp->if_nvlans > 0)) {

this is an example, may be fixed by other way...

>Release-Note:
>Audit-Trail:

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: freebsd-gnats-submit@FreeBSD.org, blackv@netroad.ru
Cc:  
Subject: Re: kern/72933: [patch] promisc mode on vlan interface does not work correctly
Date: Fri, 19 Nov 2004 13:05:04 +0300

 Hi there,
 
 While the fix you proposed looks really reasonable, I cannot see
 how it helps in your particular case.  If you look at the code,
 you'll see that the first conditional there is !BDG_ACTIVE(ifp),
 which isn't true in your setting.  Any ideas?
 
 By the way, would you mind using context or unified diff format?
 Telling "change file bar.c line number X to FOO" isn't a good way
 of sending patches since it isn't robust to other changes that may
 have happened to the source file in the meantime.  Moreover, the
 said format gives context to discuss the code in while your way
 doesn't.  Thanks.
 
 -- 
 Yar
State-Changed-From-To: open->feedback 
State-Changed-By: yar 
State-Changed-When: Mon Oct 3 10:15:34 GMT 2005 
State-Changed-Why:  
This problem is believed to be fixed in CURRENT and RELENG_6. 
Would you mind checking if you still can reproduce it in your 
environment using a newer version of FreeBSD?  Thanks! 


Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Mon Oct 3 10:15:34 GMT 2005 
Responsible-Changed-Why:  
So that I can see feedback. 

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

From: Lev Shamardin <shamardin@theory.sinp.msu.ru>
To: bug-followup@FreeBSD.org, blackv@netroad.ru
Cc:  
Subject: Re: kern/72933: [netgraph] [patch] promisc mode on vlan interface
 does not work correctly
Date: Fri, 28 Oct 2005 01:19:06 +0400

 Hi there,
 
 No, the bug is still there in RELENG_6. Tested on FreeBSD virgin.v.gz.ru 6.0-RC1 
 FreeBSD 6.0-RC1 #1: Thu Oct 20 15:22:35 MSD 2005) and em network interface.
 
 --
 Lev.

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/72933: [netgraph] [patch] promisc mode on vlan interface does not work correctly
Date: Sun, 30 Jul 2006 00:55:15 +0400

 This problem should be fixed by if_em.c#1.122 (waiting for
 the acknowledgement from yongari@).
 
 -- 
 Yar

From: Pyun YongHyeon <pyunyh@gmail.com>
To: Bruce M Simpson <bms@incunabulum.net>
Cc: yar@freebsd.org, yongari@freebsd.org
Subject: Re: kern/72933: [netgraph] [patch] promisc mode on vlan interface does not work correctly
Date: Sun, 11 Feb 2007 16:31:56 +0900

 On Sat, Feb 10, 2007 at 08:10:15PM +0000, Bruce M Simpson wrote:
  > may this PR be closed now?
  > 
 
 I'm not sure bge(4) has no issues on hw VLAN tagging but both
 em(4)/msk(4) should work. For em(4)'s case it should work
 after if_em.c, rev 1.122.
 
  > BMS
 
 -- 
 Regards,
 Pyun YongHyeon

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: Pyun YongHyeon <pyunyh@gmail.com>
Cc: Bruce M Simpson <bms@incunabulum.net>, yongari@freebsd.org,
        oleg@freebsd.org, bug-followup@freebsd.org
Subject: Re: kern/72933: [netgraph] [patch] promisc mode on vlan interface does not work correctly
Date: Sun, 11 Feb 2007 11:40:34 +0300

 On Sun, Feb 11, 2007 at 04:31:56PM +0900, Pyun YongHyeon wrote:
 > On Sat, Feb 10, 2007 at 08:10:15PM +0000, Bruce M Simpson wrote:
 >  > may this PR be closed now?
 >  > 
 > 
 > I'm not sure bge(4) has no issues on hw VLAN tagging but both
 > em(4)/msk(4) should work. For em(4)'s case it should work
 > after if_em.c, rev 1.122.
 
 Thanks!  I was under the same impression as to if_em.
 
 I think we should ask oleg@ how well promisc mode goes with VLAN
 hw tagging in if_bge -- adding him to CC.
 
 -- 
 Yar
State-Changed-From-To: feedback->patched 
State-Changed-By: yar 
State-Changed-When: Thu Jul 12 20:21:49 UTC 2007 
State-Changed-Why:  
Granting the recent changes to the drivers as well as to the generic 
code in if_ethersubr.c, I really doubt that this bug can persist 
in HEAD.  OTOH, it might still lurk in RELENG_6, so this PR should 
be OK to close after RELENG_6 reaches the end of its active life, 
i.e., after the last release on it is out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72933 
State-Changed-From-To: patched->closed 
State-Changed-By: mav 
State-Changed-When: Sat Jan 10 00:09:10 UTC 2009 
State-Changed-Why:  
According to discussion this can be closed as last 6.x release 
is out. 

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