summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2019-01-08 01:47:55 +0000
committerclaudio <claudio@openbsd.org>2019-01-08 01:47:55 +0000
commitdcde58669939b1987ea1bf00f14645dc74161ef9 (patch)
treec3d6b592caebb18f318568691c6863d34ed5ed30 /sys/netinet/raw_ip.c
parentExtents code has its own set of flags and does not use malloc's. (diff)
downloadwireguard-openbsd-dcde58669939b1987ea1bf00f14645dc74161ef9.tar.xz
wireguard-openbsd-dcde58669939b1987ea1bf00f14645dc74161ef9.zip
Botched up an if conditional in the last commit. The IP length needs to
bigger than the IP header len to be valid. With this I can traceroute again.
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index a141d41f88f..9fa04f328a3 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.117 2019/01/07 07:54:25 claudio Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.118 2019/01/08 01:47:55 claudio Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -309,7 +309,7 @@ rip_chkhdr(struct mbuf *m, struct mbuf *options)
/* Don't allow packet length sizes that will crash. */
if (hlen < sizeof (struct ip) ||
- hlen < ntohs(ip->ip_len) ||
+ ntohs(ip->ip_len) < hlen ||
ntohs(ip->ip_len) != m->m_pkthdr.len) {
m_freem(m);
return NULL;