From 5618cbd518c18007e4ad6e8c45b6432f00579591 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 2 May 2015 17:16:07 +0000 Subject: [PATCH] A ttl of 0 is valid. While here use MAXTTL instead of 255. Input bluhm@, OK krw@ --- sbin/ping/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 766bce764f5..3fe66d63748 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.121 2015/04/20 00:36:51 dlg Exp $ */ +/* $OpenBSD: ping.c,v 1.122 2015/05/02 17:16:07 florian Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -317,7 +317,7 @@ main(int argc, char *argv[]) #endif /* SMALL */ case 't': options |= F_TTL; - ttl = (u_char)strtonum(optarg, 1, 255, &errstr); + ttl = strtonum(optarg, 0, MAXTTL, &errstr); if (errstr) errx(1, "ttl value is %s: %s", errstr, optarg); break; -- 2.20.1