Skip to content

Commit

Permalink
ping: Restore -i0
Browse files Browse the repository at this point in the history
-i 0 has been supported for a long time, restore it back.
There is no point to force user to set very minimal value to emulate 0.

Found by LTP tests (nft01.sh, iptables01.sh) which use it.

Fixes: 2a63b94 ("ping: Fix overflow on negative -i")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
  • Loading branch information
pevik committed Jan 16, 2024
1 parent 056bf44 commit b034554
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ping/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ main(int argc, char **argv)
double optval;

optval = ping_strtod(optarg, _("bad timing interval"));
if (islessequal(optval, 0) || isgreater(optval, (double)INT_MAX / 1000))
if (isless(optval, 0) || isgreater(optval, (double)INT_MAX / 1000))
error(2, 0, _("bad timing interval: %s"), optarg);
rts.interval = (int)(optval * 1000);
rts.opt_interval = 1;
Expand Down

0 comments on commit b034554

Please sign in to comment.