summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-05-04 11:56:33 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-05-04 11:56:33 +0000
commit34f42003a7cbe252e190eea019992c1456b439ba (patch)
tree64f8c6208684fa752f1f029c8873a1fbb29b552f /sys
parent76e1e775fbb82328130296cdc9c7b28db8b3ca38 (diff)
Free mbuf when dropping invalid ARP with ar_hrd != ARPHRD_ETHER, instead
of leaking. Reported by orjan.sjelvgren@ignite.com. ok jason@, krw@ and henning@.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/if_ether.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index f525f2e9f7e..8c133413626 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.45 2002/06/09 16:26:10 itojun Exp $ */
+/* $OpenBSD: if_ether.c,v 1.46 2003/05/04 11:56:32 dhartmei Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -445,8 +445,10 @@ arpintr()
continue;
ar = mtod(m, struct arphdr *);
- if (ntohs(ar->ar_hrd) != ARPHRD_ETHER)
+ if (ntohs(ar->ar_hrd) != ARPHRD_ETHER) {
+ m_freem(m);
continue;
+ }
len += 2 * (ar->ar_hln + ar->ar_pln);
if (m->m_len < len && (m = m_pullup(m, len)) == NULL)