Don't let ether_input() to do the bridging work, i.e. change input iface,
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 5 Jun 2007 13:41:39 +0000 (13:41 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 5 Jun 2007 13:41:39 +0000 (13:41 +0000)
commit3ce6723372617019e5d82ba6a18a653d52f6b954
tree8b03ed1e4d3fa16181672bcfa2013678d7f89a71
parentb356165c154a1b952d0b51e18a0b9dba66766acc
Don't let ether_input() to do the bridging work, i.e. change input iface,
since it breaks following things:
o  IFF_MONITOR support.
o  Assumption that ether_input() is called with input iface's serializer
   held.
o  Per interface input packets and bytes statistics.

Let the bridge(4) handle the input iface change, which is centralized
at the end of bridge_input() after leaving bridge(4) iface's serializer.
We call ifnet.if_input() when handling iface change, instead of skipping
the "upper" half of ifnet.if_input() as we did originally; the assumption
that "upper" half of ifnet.if_input() does nothing according to input iface
does not sounds good.  M_PROTO1 mbuf flag is used to prevent infinite loop;
we may need to create a meaningful alias macro for it.

Other changes:
- Delay bridge_lookup_member_if() call until it is really necessary.
- Update ipackets for bridge(4) iface, if mcast/bcast packet is received
  and is going to be delivered to bridge(4) iface.
- Use IF_LLADDR() macro to get bridge(4) iface's MAC address.
- Nuke never reached code.
- Minor style changes.
sys/net/bridge/if_bridge.c
sys/net/if_ethersubr.c