diff options
author | luigi <luigi@FreeBSD.org> | 1998-09-18 20:55:50 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 1998-09-18 20:55:50 +0000 |
commit | 6554ecc3baf53eb9926464155b7d133d7f1dfb7d (patch) | |
tree | 302f690d4897696e1bdc58e437a18e488fcbf6fd /sys/net | |
parent | 8f86657c69b9e304ede95ddb81d741f4b8c5dd00 (diff) | |
download | FreeBSD-src-6554ecc3baf53eb9926464155b7d133d7f1dfb7d.zip FreeBSD-src-6554ecc3baf53eb9926464155b7d133d7f1dfb7d.tar.gz |
fix an mbuf leak when using ipfw to filger bridged packets
(from -stable, since this code is not yet active in -current)
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bridge.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 4c0eee2..7c2e0f2 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -508,7 +508,7 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst) if (src == NULL) goto forward ; /* do not apply to packets from ether_output */ if (canfree == 0 ) /* need to make a copy */ - m = m_copypacket(*m0, M_DONTWAIT); /* ??? ticks on a P90 */ + m = m_copypacket(*m0, M_DONTWAIT); if (m == NULL) { /* fail... */ return 0 ; @@ -522,8 +522,11 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst) *m0 = NULL ; return 0 ; } - if (off == 0) + if (off == 0) { + if (canfree == 0) + m_freem(m); goto forward ; + } #ifdef DUMMYNET if (off & 0x10000) { /* |