Don't let ether_input() to do the bridging work, i.e. change input iface,
commit5517ec7c9145cc94a518d371b2fa46b8377425ce
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 5 Jun 2007 13:41:39 +0000 (5 13:41 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 5 Jun 2007 13:41:39 +0000 (5 13:41 +0000)
treedcd13cac53002989b01e0dcf287ad583a980e4d6
parent4bc998c64a6223199ab5b14aa6c2b4175050f9d2
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