Skip to content

Commit

Permalink
ping: parsetos verification is enough, allow decimal values
Browse files Browse the repository at this point in the history
Drop rest of code, duplicated and buggy.

Fixes: iputils#70

Signed-off-by: David Heidelberg <david@ixit.cz>
  • Loading branch information
okias committed Jul 31, 2017
1 parent 83fce50 commit 25290b6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,8 @@ main(int argc, char **argv)
options |= F_QUIET;
break;
case 'Q':
/* IPv4 */
settos = parsetos(optarg);
/* IPv6 */
tclass = hextoui(optarg);
if (errno || (tclass & ~0xff)) {
fprintf(stderr, "ping: Invalid tclass %s\n", optarg);
exit(2);
}
settos = parsetos(optarg); /* IPv4 */
tclass = settos; /* IPv6 */
break;
case 'r':
options |= F_SO_DONTROUTE;
Expand Down

0 comments on commit 25290b6

Please sign in to comment.