kernel - More if_bridge work + misc fixes
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 22 Feb 2011 00:02:30 +0000 (16:02 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 22 Feb 2011 00:02:30 +0000 (16:02 -0800)
commit4ee4f75304954a71220b5a900bae7f56a019ab5a
tree9bb87e776fb7ae9172ec57caf69938b540238a8d
parent4ee0d87668ca4b34f885d611618301b099ab39ae
kernel - More if_bridge work + misc fixes

* When bridging packets sent from one of our own MACs we always override
  the ether_shost in the output packet so it comes from the actual
  interface the packet is being sent out on.

* LINK0 will still nominally keep the ether_shost intact when forwarding
  across a bridge, except in the above case.  That is, any foreign MAC
  set as the source coming in on one interface will be retained as the
  source when being thrown out on another interface.  But any local MAC
  will be replaced with the MAC of the outgoing interface.

* When receiving a unicast frame on one interface which is targetted to
  another interface, retain the original rcvif for any vlan or arp
  processing.  Otherwise (for example) if this were an ARP reply the ARP
  code would associate the reply with the wrong interface.  We would want
  the ARP entry to be associated with the first interface, not the second,
  because the first interface is the one the reply actually came in on.

* Adjust the ARP code in if_ether.c to use rcvif and not ifp, and don't
  log if non-matching interfaces are part of the same bridge (unless
  log_arp_wrong_iface is set to 2).

* Augment the ether_reinput_cpu() API to pass additional flags in,
  allowing the caller to specify that m->m_pkthdr.rcvif not be
  overwritten.  Used to support the above features.

* Clear M_HASH in a few more cases in pf.c
sys/net/bridge/if_bridge.c
sys/net/ethernet.h
sys/net/if_ethersubr.c
sys/net/if_var.h
sys/net/pf/pf.c
sys/net/vlan/if_vlan.c
sys/netinet/if_ether.c