summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-12-01 12:33:29 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-12-01 12:33:29 +0000
commit97df163c6c94c9a0e91b045e63342498ae8169a6 (patch)
treef9e9dcec8d9e7aa9f5bd52b5980605211f303c39 /sys/netinet
parent6bc933c1a4b580fbb4853953ad9dc27c1bd6f418 (diff)
rangecheck ttl on IP_TTL, collected dust in my tree
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index adbb3ecd32f..1df80f8c50b 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.182 2006/10/11 09:34:51 henning Exp $ */
+/* $OpenBSD: ip_output.c,v 1.183 2006/12/01 12:33:28 henning Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -1061,7 +1061,10 @@ ip_ctloutput(op, so, level, optname, mp)
break;
case IP_TTL:
- inp->inp_ip.ip_ttl = optval;
+ if (optval > 0 && optval <= MAXTTL)
+ inp->inp_ip.ip_ttl = optval;
+ else
+ error = EINVAL;
break;
case IP_MINTTL: