diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-08-13 07:19:59 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-08-13 07:19:59 +0000 |
commit | 568d83a322a315afeab4fee971c765b5e8f28bdd (patch) | |
tree | 4856997f32c98269b300056d5c56a1db77d31f23 /sys | |
parent | 2879cb4f70e05398fe8b5870f88e3292c8029e44 (diff) |
If no handler consumed a mbuf, free it. This also apply if an interface
does not have any registered handler.
Plug a mbuf leak found by sthen@ with gif(4) in a bridge.
ok sthen@, claudio@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index a0e23d64d45..a195707195c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.356 2015/07/29 00:04:03 rzalamena Exp $ */ +/* $OpenBSD: if.c,v 1.357 2015/08/13 07:19:58 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -538,6 +538,8 @@ if_input_process(void *xmq) if ((*ifih->ifih_input)(ifp, m)) break; } + if (ifih == NULL) + m_freem(m); } splx(s); KERNEL_UNLOCK(); |