diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
commit | cad5364599eb5062d59e0c397ed638ddd61a8d5d (patch) | |
tree | a318d0f03aa076c74b576ea45dc543a5669e8e91 /networking/traceroute.c | |
parent | e01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff) | |
download | busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2 busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip |
Major coreutils update.
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r-- | networking/traceroute.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index a9cad4baf..be9ea1d95 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -448,7 +448,7 @@ traceroute_main(int argc, char *argv[]) | |||
448 | case 'm': | 448 | case 'm': |
449 | max_ttl = atoi(optarg); | 449 | max_ttl = atoi(optarg); |
450 | if (max_ttl <= 1) | 450 | if (max_ttl <= 1) |
451 | error_msg_and_die("max ttl must be >1."); | 451 | bb_error_msg_and_die("max ttl must be >1."); |
452 | break; | 452 | break; |
453 | case 'n': | 453 | case 'n': |
454 | nflag++; | 454 | nflag++; |
@@ -456,12 +456,12 @@ traceroute_main(int argc, char *argv[]) | |||
456 | case 'p': | 456 | case 'p': |
457 | port = atoi(optarg); | 457 | port = atoi(optarg); |
458 | if (port < 1) | 458 | if (port < 1) |
459 | error_msg_and_die("port must be >0."); | 459 | bb_error_msg_and_die("port must be >0."); |
460 | break; | 460 | break; |
461 | case 'q': | 461 | case 'q': |
462 | nprobes = atoi(optarg); | 462 | nprobes = atoi(optarg); |
463 | if (nprobes < 1) | 463 | if (nprobes < 1) |
464 | error_msg_and_die("nprobes must be >0."); | 464 | bb_error_msg_and_die("nprobes must be >0."); |
465 | break; | 465 | break; |
466 | case 'r': | 466 | case 'r': |
467 | options |= SO_DONTROUTE; | 467 | options |= SO_DONTROUTE; |
@@ -476,7 +476,7 @@ traceroute_main(int argc, char *argv[]) | |||
476 | case 't': | 476 | case 't': |
477 | tos = atoi(optarg); | 477 | tos = atoi(optarg); |
478 | if (tos < 0 || tos > 255) | 478 | if (tos < 0 || tos > 255) |
479 | error_msg_and_die("tos must be 0 to 255."); | 479 | bb_error_msg_and_die("tos must be 0 to 255."); |
480 | break; | 480 | break; |
481 | case 'v': | 481 | case 'v': |
482 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 482 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE |
@@ -486,16 +486,16 @@ traceroute_main(int argc, char *argv[]) | |||
486 | case 'w': | 486 | case 'w': |
487 | waittime = atoi(optarg); | 487 | waittime = atoi(optarg); |
488 | if (waittime <= 1) | 488 | if (waittime <= 1) |
489 | error_msg_and_die("wait must be >1 sec."); | 489 | bb_error_msg_and_die("wait must be >1 sec."); |
490 | break; | 490 | break; |
491 | default: | 491 | default: |
492 | show_usage(); | 492 | bb_show_usage(); |
493 | } | 493 | } |
494 | argc -= optind; | 494 | argc -= optind; |
495 | argv += optind; | 495 | argv += optind; |
496 | 496 | ||
497 | if (argc < 1) | 497 | if (argc < 1) |
498 | show_usage(); | 498 | bb_show_usage(); |
499 | 499 | ||
500 | setlinebuf (stdout); | 500 | setlinebuf (stdout); |
501 | 501 | ||
@@ -507,7 +507,7 @@ traceroute_main(int argc, char *argv[]) | |||
507 | if (*++argv) | 507 | if (*++argv) |
508 | datalen = atoi(*argv); | 508 | datalen = atoi(*argv); |
509 | if (datalen < 0 || datalen >= MAXPACKET - sizeof(struct opacket)) | 509 | if (datalen < 0 || datalen >= MAXPACKET - sizeof(struct opacket)) |
510 | error_msg_and_die("packet size must be 0 <= s < %d.", | 510 | bb_error_msg_and_die("packet size must be 0 <= s < %d.", |
511 | MAXPACKET - sizeof(struct opacket)); | 511 | MAXPACKET - sizeof(struct opacket)); |
512 | datalen += sizeof(struct opacket); | 512 | datalen += sizeof(struct opacket); |
513 | outpacket = (struct opacket *)xmalloc((unsigned)datalen); | 513 | outpacket = (struct opacket *)xmalloc((unsigned)datalen); |
@@ -520,7 +520,7 @@ traceroute_main(int argc, char *argv[]) | |||
520 | ident = (getpid() & 0xffff) | 0x8000; | 520 | ident = (getpid() & 0xffff) | 0x8000; |
521 | 521 | ||
522 | if ((sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) | 522 | if ((sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) |
523 | perror_msg_and_die(can_not_create_raw_socket); | 523 | bb_perror_msg_and_die(bb_msg_can_not_create_raw_socket); |
524 | 524 | ||
525 | s = create_icmp_socket(); | 525 | s = create_icmp_socket(); |
526 | 526 | ||
@@ -535,12 +535,12 @@ traceroute_main(int argc, char *argv[]) | |||
535 | #ifdef SO_SNDBUF | 535 | #ifdef SO_SNDBUF |
536 | if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&datalen, | 536 | if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&datalen, |
537 | sizeof(datalen)) < 0) | 537 | sizeof(datalen)) < 0) |
538 | perror_msg_and_die("SO_SNDBUF"); | 538 | bb_perror_msg_and_die("SO_SNDBUF"); |
539 | #endif | 539 | #endif |
540 | #ifdef IP_HDRINCL | 540 | #ifdef IP_HDRINCL |
541 | if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, (char *)&on, | 541 | if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, (char *)&on, |
542 | sizeof(on)) < 0) | 542 | sizeof(on)) < 0) |
543 | perror_msg_and_die("IP_HDRINCL"); | 543 | bb_perror_msg_and_die("IP_HDRINCL"); |
544 | #endif | 544 | #endif |
545 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG | 545 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG |
546 | if (options & SO_DEBUG) | 546 | if (options & SO_DEBUG) |
@@ -556,11 +556,11 @@ traceroute_main(int argc, char *argv[]) | |||
556 | from.sin_family = AF_INET; | 556 | from.sin_family = AF_INET; |
557 | from.sin_addr.s_addr = inet_addr(source); | 557 | from.sin_addr.s_addr = inet_addr(source); |
558 | if (from.sin_addr.s_addr == -1) | 558 | if (from.sin_addr.s_addr == -1) |
559 | error_msg_and_die("unknown host %s", source); | 559 | bb_error_msg_and_die("unknown host %s", source); |
560 | outpacket->ip.ip_src = from.sin_addr; | 560 | outpacket->ip.ip_src = from.sin_addr; |
561 | #ifndef IP_HDRINCL | 561 | #ifndef IP_HDRINCL |
562 | if (bind(sndsock, (struct sockaddr *)&from, sizeof(from)) < 0) | 562 | if (bind(sndsock, (struct sockaddr *)&from, sizeof(from)) < 0) |
563 | perror_msg_and_die("bind"); | 563 | bb_perror_msg_and_die("bind"); |
564 | #endif | 564 | #endif |
565 | } | 565 | } |
566 | 566 | ||