Bug 127815 - [gif] [patch] if_gif does not set vlan attributes from EtherIP encapsulated 802.1 packets
Summary: [gif] [patch] if_gif does not set vlan attributes from EtherIP encapsulated 8...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.1-BETA1
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2008-10-03 13:00 UTC by Serge Potapov
Modified: 2022-10-17 12:36 UTC (History)
0 users

See Also:


Attachments
file.diff (1.16 KB, patch)
2008-10-03 13:00 UTC, Serge Potapov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Potapov 2008-10-03 13:00:10 UTC
vlan2, mac2 -> interface2
vlan3, mac1 -> interface1

and so on.

When gif interface receives EtherIP encapsulating 802.1Q packet it does
not set m->m_pkthdr.ether_vtag and m->m_flags |= M_VLANTAG.

Chain:

ether<->if_bridge<->gif<->gif<->if_bridge<->ether

transmits vlan tagged packets properly, but if_bridge bridge stores all MAC addresses learned from gif side in vlan1.

In point-to-multipoint environment unicast 802.1Q (vlan_tag != 1) packets received from physical ethernet interface will be always sent over all gif interfaces attached to if_bridge.

Fix: Patch attached.
Not sure about proper place.
After patching vlan MACs stored properly and bridge woriking right.
Not tested too much.


Patch attached with submission follows:
How-To-Repeat: Simple, but need a lot of equipment.

=
|    em0 +------+ em1  fxp0 +-------+
+--------+ CPE1 +-----------+ HOST1 |
|   $ip1 +------+           +-------+
|
|    em0 +------+ em1  fxp0 +-------+
+--------+ CPE2 +-----------+ HOST2 |
|   $ip3 +------+           +-------+
|
|    em0 +------+ em1  fxp0 +-------+
+--------+ CPE3 +-----------| HOST3 |
|   $ip3 +------+           +-------+
=

CPE1:

ifconfig bridge0 create;
ifconfig em1 up; ifconfig bridge0 addm em1 up
ifconfig gif2 create; ifconfig gif2 tunnel $ip1 $ip2
ifconfig bridge0 addm gif2; ifconfig bridge0 private gif2
ifconfig gif3 create; ifconfig gif3 tunnel $ip1 $ip3
ifconfig bridge0 addm gif3; ifconfig bridge0 private gif3

CPE2:

ifconfig bridge0 create
ifconfig em1 up; ifconfig bridge0 addm1 up
ifconfig gif1 create; ifconfig gif1 tunnel $ip2 $ip1
ifconfig bridge0 addm gif1; ifconfig bridge0 private gif1
ifconfig gif3 create; ifconfig gif3 tunnel $ip2 $ip3
ifconfig bridge0 addm gif3; ifconfig bridge0 private gif3

CPE3:

ifconfig bridge0 create
ifconfig em1 up; ifconfig bridge0 addm1 up
ifconfig gif1 create; ifconfig gif1 tunnel $ip3 $ip1
ifconfig bridge0 addm gif1; ifconfig bridge0 private gif1
ifconfig gif2 create; ifconfig gif2 tunnel $ip3 $ip2
ifconfig bridge0 addm gif2; ifconfig bridge0 private gif2

===================================================================
With plain 802.1 ethernet all works fine (thanks for private flag).
No extra traffic, no loops. Almost poor man's VPLS.

But after:

HOST1:

ifconfig fxp0 up
ifconfig vlan5 create
ifconfig vlan5 10.10.10.1/24 vlan 5 vlandev fxp0

HOST2:

ifconfig fxp0 up
ifconfig vlan5 create
ifconfig vlan5 10.10.10.2/24 vlan 5 vlandev fxp0
ping 10.10.10.1

CPE2 will send all icmp requests received on em1 over gif1 and gif3 [waste]
CPE1 will sens all icmp replies received on em0 over gif2 and gif3 [waste]

CPE3 will receive icmp requests on gif2 and replies on gif1 and send
all packets to em1.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-10-03 15:44:00 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:48 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:44 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>