aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/bpf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index a934adf68c4d..debed79915e7 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -575,8 +575,10 @@ bpfwrite(dev, uio, ioflag)
if (error)
return (error);
- if (datlen > ifp->if_mtu)
+ if (datlen > ifp->if_mtu) {
+ m_freem(m);
return (EMSGSIZE);
+ }
if (d->bd_hdrcmplt)
dst.sa_family = pseudo_AF_HDRCMPLT;