summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2006-12-01 12:33:28 +0000
committerhenning <henning@openbsd.org>2006-12-01 12:33:28 +0000
commit39fd24475fe1f3b51a4c3a6e83c9f56c0e350385 (patch)
tree32765c2a4920dbfdc9f7ffeefeaea97281bc74f0 /sys
parentiskampds public key local.pub moved from /etc/isakmpd/private to (diff)
downloadwireguard-openbsd-39fd24475fe1f3b51a4c3a6e83c9f56c0e350385.tar.xz
wireguard-openbsd-39fd24475fe1f3b51a4c3a6e83c9f56c0e350385.zip
rangecheck ttl on IP_TTL, collected dust in my tree
Diffstat (limited to 'sys')
-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: