summaryrefslogtreecommitdiff
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-01-08 01:47:56 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-01-08 01:47:56 +0000
commite7bc1f90c9318bee5f915b5cad0a9c6b0d5c32cd (patch)
treeae556328c6eec5a86418e7357d03d5a3cc891734 /sys/netinet/raw_ip.c
parent26d350937c251097d923bee5547bad5db6ee6463 (diff)
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;