Bug 115019 - [netgraph] ng_ether upper hook packet flow stops on adding ethernet interface to ifconfig bridge
Summary: [netgraph] ng_ether upper hook packet flow stops on adding ethernet interface...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-29 21:40 UTC by Kirill Nuzhdin
Modified: 2022-08-26 21:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Nuzhdin 2007-07-29 21:40:01 UTC
If we add ethernet interface to ifconfig bridge, a packet flow from the upper hook of the ether node of a netgraph construction disappears. Meanwhile, packet flow from the lower hook is not effected.

Following tests show that on adding ethernet interface to an ifconfig bridge, corresponding netgraph node "forgets" about its upper hook.


Without loss of generality one can use instead of an arbitrary netgraph construction a tee netgraph node. 

Initial position:
1. bce1 - ethernet interface (or fxp, does not matter)

2. netgraph construction:
ngctl mkpeer bce1: tee lower right
ngctl connect bce1:lower bce1: left upper

3. traffic monitoring with NGM_TEE_GET_STATS:
ngctl msg bce1:lower getstats
or
ngctl msg bce1:upper getstats

4. traffic flow from external net to bce1 interface and vice versa

initial position, action: 
no action
result:
- left2right hook shows traffic flow
- right2left hook shows traffic flow
- traffic through bce1 flows normally

initial position, action: 
# ifconfig bridge0 create
# ifconfig bridge0 addm bce1
result:
- left2right hook shows no traffic
- right2left hook shows traffic flow
- traffic through bce1 flows normally

initial position, action: 
# ifconfig bridge0 create
# ifconfig bridge0 addm bce1
# ngctl rmhook bce1: lower
result:
- left2right hook shows no traffic
- right2left hook shows no traffic
- traffic through bce1 flows stops

initial position, action: 
# ifconfig bridge0 create
# ifconfig bridge0 addm bce1
# ngctl rmhook bce1: upper
result:
- left2right hook shows no traffic
- right2left hook shows traffic flow
- traffic through bce1 flows normally


Also reproducible in this environment: FreeBSD gw.local 6.2-STABLE FreeBSD 6.2-STABLE #0: Sat Jun 16 13:24:55 MSD 2007     root@gw.local:/usr/obj/usr/src/sys/GW  i386

How-To-Repeat: - kldload ng_tee
  kldload ng_ether
  ngctl mkpeer if0: tee lower right
  ngctl connect if0:lower if0: left upper
- ngctl msg if0:lower getstats
  make sure left->right and right->left hooks traffic is fine
- ifconfig bridge0 create
  ifconfig bridge0 addm if0
- ngctl msg if0:lower getstats
- make sure there is no left->right hooks traffic
Comment 1 Bruce Cran freebsd_committer freebsd_triage 2009-01-30 23:13:30 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:40 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