diff options
author | Jason Wright <jason@cvs.openbsd.org> | 1999-10-26 03:40:18 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 1999-10-26 03:40:18 +0000 |
commit | 343a6a0ed2d4c0d688ae9127aa271716707b2576 (patch) | |
tree | 406d6d5ab27953cce3cd7578294998c8cc0c42f6 | |
parent | 24d4b493d2507aa56918d9ddc82b0c5b821c2c1f (diff) |
rewriting the header for packets originating from the bridge is
unncessary since we check for incoming frames destined to any
of the bridged interfaces. Also change the full mbuf copy to a
referenced copy.
-rw-r--r-- | sys/net/if_bridge.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index b35b2ad2459..a2badf8f187 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.18 1999/09/30 02:10:18 jason Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.19 1999/10/26 03:40:17 jason Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -588,7 +588,7 @@ bridge_output(ifp, m, sa, rt) /* * If the packet is a broadcast or we don't know a better way to - * get there, we must broadcast with header rewriting. + * get there. */ dst_if = bridge_rtlookup(sc, dst); if (dst_if == NULL || eh->ether_dhost[0] & 1) { @@ -602,36 +602,12 @@ bridge_output(ifp, m, sa, rt) continue; } - /* - * Make a full copy of the packet (sigh) - */ - mc = m_copym2(m, 0, M_COPYALL, M_NOWAIT); + mc = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (mc == NULL) { sc->sc_if.if_oerrors++; continue; } - /* - * If packet does not have a multicast or broadcast - * destination, rewrite the header to contain - * the current interface's address. - */ - if ((eh->ether_shost[0] & 1) == 0) { - struct arpcom *cac = (struct arpcom *)p->ifp; - struct ether_header *ceh; - struct ether_addr *csrc; - - if (mc->m_len < sizeof(*ceh)) { - mc = m_pullup(mc, sizeof(*ceh)); - if (mc == NULL) - continue; - } - ceh = mtod(mc, struct ether_header *); - csrc = (struct ether_addr *) - &ceh->ether_shost[0]; - bcopy(cac->ac_enaddr, csrc, ETHER_ADDR_LEN); - } - sc->sc_if.if_opackets++; sc->sc_if.if_obytes += m->m_pkthdr.len; IF_ENQUEUE(&p->ifp->if_snd, mc); |