diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-21 10:15:25 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-21 10:15:25 +0000 |
commit | 04291bc5aee1e020997894cfd497d14392ad2ced (patch) | |
tree | f9f70d597f2476efe5819b15e8d749725653773f /networking | |
parent | 3eb91c2e3594f379f357bfcc85105b6b76a11781 (diff) | |
download | busybox-w32-04291bc5aee1e020997894cfd497d14392ad2ced.tar.gz busybox-w32-04291bc5aee1e020997894cfd497d14392ad2ced.tar.bz2 busybox-w32-04291bc5aee1e020997894cfd497d14392ad2ced.zip |
httpd: slight reduction of #ifdef forest
few other applets: #ifdef CONFIG_ -> #if ENABLE_
traceroute: fix exposed bugs
defconfig: update
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 15 | ||||
-rw-r--r-- | networking/tftp.c | 28 | ||||
-rw-r--r-- | networking/traceroute.c | 67 | ||||
-rw-r--r-- | networking/udhcp/static_leases.c | 2 | ||||
-rw-r--r-- | networking/zcip.c | 5 |
5 files changed, 56 insertions, 61 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 08b40e014..3b948b98d 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1756,22 +1756,19 @@ static int miniHttpd(int server) | |||
1756 | /* set the KEEPALIVE option to cull dead connections */ | 1756 | /* set the KEEPALIVE option to cull dead connections */ |
1757 | on = 1; | 1757 | on = 1; |
1758 | setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on)); | 1758 | setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on)); |
1759 | #if !DEBUG | 1759 | |
1760 | if (fork() == 0) | 1760 | if (DEBUG || fork() == 0) { |
1761 | #endif | 1761 | /* child */ |
1762 | { | ||
1763 | /* This is the spawned thread */ | ||
1764 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | 1762 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP |
1765 | /* protect reload config, may be confuse checking */ | 1763 | /* protect reload config, may be confuse checking */ |
1766 | signal(SIGHUP, SIG_IGN); | 1764 | signal(SIGHUP, SIG_IGN); |
1767 | #endif | 1765 | #endif |
1768 | handleIncoming(); | 1766 | handleIncoming(); |
1769 | #if !DEBUG | 1767 | if (!DEBUG) |
1770 | exit(0); | 1768 | exit(0); |
1771 | #endif | ||
1772 | } | 1769 | } |
1773 | close(s); | 1770 | close(s); |
1774 | } // while (1) | 1771 | } /* while (1) */ |
1775 | return 0; | 1772 | return 0; |
1776 | } | 1773 | } |
1777 | 1774 | ||
diff --git a/networking/tftp.c b/networking/tftp.c index 6213d6622..64d376fa7 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -60,7 +60,7 @@ static const char *const tftp_bb_error_msg[] = { | |||
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | 62 | ||
63 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 63 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
64 | 64 | ||
65 | static int tftp_blocksize_check(int blocksize, int bufsize) | 65 | static int tftp_blocksize_check(int blocksize, int bufsize) |
66 | { | 66 | { |
@@ -204,7 +204,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
204 | memcpy(cp, MODE_OCTET, MODE_OCTET_LEN); | 204 | memcpy(cp, MODE_OCTET, MODE_OCTET_LEN); |
205 | cp += MODE_OCTET_LEN; | 205 | cp += MODE_OCTET_LEN; |
206 | 206 | ||
207 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 207 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
208 | 208 | ||
209 | len = tftp_bufsize - 4; /* data block size */ | 209 | len = tftp_bufsize - 4; /* data block size */ |
210 | 210 | ||
@@ -261,7 +261,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
261 | 261 | ||
262 | len = cp - buf; | 262 | len = cp - buf; |
263 | 263 | ||
264 | #ifdef CONFIG_DEBUG_TFTP | 264 | #if ENABLE_DEBUG_TFTP |
265 | fprintf(stderr, "sending %u bytes\n", len); | 265 | fprintf(stderr, "sending %u bytes\n", len); |
266 | for (cp = buf; cp < &buf[len]; cp++) | 266 | for (cp = buf; cp < &buf[len]; cp++) |
267 | fprintf(stderr, "%02x ", (unsigned char) *cp); | 267 | fprintf(stderr, "%02x ", (unsigned char) *cp); |
@@ -337,7 +337,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
337 | opcode = ntohs(*((unsigned short *) buf)); | 337 | opcode = ntohs(*((unsigned short *) buf)); |
338 | tmp = ntohs(*((unsigned short *) &buf[2])); | 338 | tmp = ntohs(*((unsigned short *) &buf[2])); |
339 | 339 | ||
340 | #ifdef CONFIG_DEBUG_TFTP | 340 | #if ENABLE_DEBUG_TFTP |
341 | fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp); | 341 | fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp); |
342 | #endif | 342 | #endif |
343 | 343 | ||
@@ -359,7 +359,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
359 | 359 | ||
360 | break; | 360 | break; |
361 | } | 361 | } |
362 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 362 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
363 | if (want_option_ack) { | 363 | if (want_option_ack) { |
364 | 364 | ||
365 | want_option_ack = 0; | 365 | want_option_ack = 0; |
@@ -382,7 +382,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
382 | } else { | 382 | } else { |
383 | opcode = TFTP_ACK; | 383 | opcode = TFTP_ACK; |
384 | } | 384 | } |
385 | #ifdef CONFIG_DEBUG_TFTP | 385 | #if ENABLE_DEBUG_TFTP |
386 | fprintf(stderr, "using %s %u\n", OPTION_BLOCKSIZE, | 386 | fprintf(stderr, "using %s %u\n", OPTION_BLOCKSIZE, |
387 | blksize); | 387 | blksize); |
388 | #endif | 388 | #endif |
@@ -448,7 +448,7 @@ static int tftp(const int cmd, const struct hostent *host, | |||
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | #ifdef CONFIG_FEATURE_CLEAN_UP | 451 | #if ENABLE_FEATURE_CLEAN_UP |
452 | close(socketfd); | 452 | close(socketfd); |
453 | free(buf); | 453 | free(buf); |
454 | #endif | 454 | #endif |
@@ -470,7 +470,7 @@ int tftp_main(int argc, char **argv) | |||
470 | 470 | ||
471 | /* figure out what to pass to getopt */ | 471 | /* figure out what to pass to getopt */ |
472 | 472 | ||
473 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 473 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
474 | char *sblocksize = NULL; | 474 | char *sblocksize = NULL; |
475 | 475 | ||
476 | #define BS "b:" | 476 | #define BS "b:" |
@@ -480,7 +480,7 @@ int tftp_main(int argc, char **argv) | |||
480 | #define BS_ARG | 480 | #define BS_ARG |
481 | #endif | 481 | #endif |
482 | 482 | ||
483 | #ifdef CONFIG_FEATURE_TFTP_GET | 483 | #if ENABLE_FEATURE_TFTP_GET |
484 | #define GET "g" | 484 | #define GET "g" |
485 | #define GET_COMPL ":g" | 485 | #define GET_COMPL ":g" |
486 | #else | 486 | #else |
@@ -488,7 +488,7 @@ int tftp_main(int argc, char **argv) | |||
488 | #define GET_COMPL | 488 | #define GET_COMPL |
489 | #endif | 489 | #endif |
490 | 490 | ||
491 | #ifdef CONFIG_FEATURE_TFTP_PUT | 491 | #if ENABLE_FEATURE_TFTP_PUT |
492 | #define PUT "p" | 492 | #define PUT "p" |
493 | #define PUT_COMPL ":p" | 493 | #define PUT_COMPL ":p" |
494 | #else | 494 | #else |
@@ -505,16 +505,16 @@ int tftp_main(int argc, char **argv) | |||
505 | cmd = getopt32(argc, argv, GET PUT "l:r:" BS, &localfile, &remotefile BS_ARG); | 505 | cmd = getopt32(argc, argv, GET PUT "l:r:" BS, &localfile, &remotefile BS_ARG); |
506 | 506 | ||
507 | cmd &= (tftp_cmd_get | tftp_cmd_put); | 507 | cmd &= (tftp_cmd_get | tftp_cmd_put); |
508 | #ifdef CONFIG_FEATURE_TFTP_GET | 508 | #if ENABLE_FEATURE_TFTP_GET |
509 | if (cmd == tftp_cmd_get) | 509 | if (cmd == tftp_cmd_get) |
510 | flags = O_WRONLY | O_CREAT | O_TRUNC; | 510 | flags = O_WRONLY | O_CREAT | O_TRUNC; |
511 | #endif | 511 | #endif |
512 | #ifdef CONFIG_FEATURE_TFTP_PUT | 512 | #if ENABLE_FEATURE_TFTP_PUT |
513 | if (cmd == tftp_cmd_put) | 513 | if (cmd == tftp_cmd_put) |
514 | flags = O_RDONLY; | 514 | flags = O_RDONLY; |
515 | #endif | 515 | #endif |
516 | 516 | ||
517 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 517 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
518 | if (sblocksize) { | 518 | if (sblocksize) { |
519 | blocksize = xatoi_u(sblocksize); | 519 | blocksize = xatoi_u(sblocksize); |
520 | if (!tftp_blocksize_check(blocksize, 0)) { | 520 | if (!tftp_blocksize_check(blocksize, 0)) { |
@@ -542,7 +542,7 @@ int tftp_main(int argc, char **argv) | |||
542 | host = xgethostbyname(argv[optind]); | 542 | host = xgethostbyname(argv[optind]); |
543 | port = bb_lookup_port(argv[optind + 1], "udp", 69); | 543 | port = bb_lookup_port(argv[optind + 1], "udp", 69); |
544 | 544 | ||
545 | #ifdef CONFIG_DEBUG_TFTP | 545 | #if ENABLE_DEBUG_TFTP |
546 | fprintf(stderr, "using server \"%s\", remotefile \"%s\", " | 546 | fprintf(stderr, "using server \"%s\", remotefile \"%s\", " |
547 | "localfile \"%s\".\n", | 547 | "localfile \"%s\".\n", |
548 | inet_ntoa(*((struct in_addr *) host->h_addr)), | 548 | inet_ntoa(*((struct in_addr *) host->h_addr)), |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 3b590630c..c4f050abb 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -196,12 +196,15 @@ | |||
196 | * Tue Dec 20 03:50:13 PST 1988 | 196 | * Tue Dec 20 03:50:13 PST 1988 |
197 | */ | 197 | */ |
198 | 198 | ||
199 | #undef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 199 | #define TRACEROUTE_SO_DEBUG 0 |
200 | |||
201 | /* TODO: undefs were uncommented - ??! we have config system for that! */ | ||
202 | /* probably ok to remove altogether */ | ||
203 | //#undef CONFIG_FEATURE_TRACEROUTE_VERBOSE | ||
200 | //#define CONFIG_FEATURE_TRACEROUTE_VERBOSE | 204 | //#define CONFIG_FEATURE_TRACEROUTE_VERBOSE |
201 | #undef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG /* not in documentation man */ | 205 | //#undef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE |
202 | #undef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | ||
203 | //#define CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 206 | //#define CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE |
204 | #undef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 207 | //#undef CONFIG_FEATURE_TRACEROUTE_USE_ICMP |
205 | //#define CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 208 | //#define CONFIG_FEATURE_TRACEROUTE_USE_ICMP |
206 | 209 | ||
207 | #include "inet_common.h" | 210 | #include "inet_common.h" |
@@ -284,17 +287,17 @@ struct IFADDRLIST { | |||
284 | static const char route[] = "/proc/net/route"; | 287 | static const char route[] = "/proc/net/route"; |
285 | 288 | ||
286 | /* last inbound (icmp) packet */ | 289 | /* last inbound (icmp) packet */ |
287 | static unsigned char packet[512] ATTRIBUTE_ALIGNED(32); | 290 | static unsigned char packet[512] ATTRIBUTE_ALIGNED(32); |
288 | 291 | ||
289 | static struct ip *outip; /* last output (udp) packet */ | 292 | static struct ip *outip; /* last output (udp) packet */ |
290 | static struct udphdr *outudp; /* last output (udp) packet */ | 293 | static struct udphdr *outudp; /* last output (udp) packet */ |
291 | static struct outdata *outdata; /* last output (udp) packet */ | 294 | static struct outdata *outdata; /* last output (udp) packet */ |
292 | 295 | ||
293 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 296 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
294 | static struct icmp *outicmp; /* last output (icmp) packet */ | 297 | static struct icmp *outicmp; /* last output (icmp) packet */ |
295 | #endif | 298 | #endif |
296 | 299 | ||
297 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 300 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
298 | /* Maximum number of gateways (include room for one noop) */ | 301 | /* Maximum number of gateways (include room for one noop) */ |
299 | #define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(u_int32_t))) | 302 | #define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(u_int32_t))) |
300 | /* loose source route gateway list (including room for final destination) */ | 303 | /* loose source route gateway list (including room for final destination) */ |
@@ -320,16 +323,16 @@ static int waittime = 5; /* time to wait for response (in seconds) | |||
320 | static int nflag; /* print addresses numerically */ | 323 | static int nflag; /* print addresses numerically */ |
321 | static int doipcksum = 1; /* calculate ip checksums by default */ | 324 | static int doipcksum = 1; /* calculate ip checksums by default */ |
322 | 325 | ||
323 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 326 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
324 | static int optlen; /* length of ip options */ | 327 | static int optlen; /* length of ip options */ |
325 | #else | 328 | #else |
326 | #define optlen 0 | 329 | #define optlen 0 |
327 | #endif | 330 | #endif |
328 | 331 | ||
329 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 332 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
330 | static int useicmp; /* use icmp echo instead of udp packets */ | 333 | static int useicmp; /* use icmp echo instead of udp packets */ |
331 | #endif | 334 | #endif |
332 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 335 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
333 | static int verbose; | 336 | static int verbose; |
334 | #endif | 337 | #endif |
335 | 338 | ||
@@ -596,14 +599,14 @@ send_probe(int seq, int ttl, struct timeval *tp) | |||
596 | outdata->ttl = ttl; | 599 | outdata->ttl = ttl; |
597 | memcpy(&outdata->tv, tp, sizeof(outdata->tv)); | 600 | memcpy(&outdata->tv, tp, sizeof(outdata->tv)); |
598 | 601 | ||
599 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 602 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
600 | if (useicmp) | 603 | if (useicmp) |
601 | outicmp->icmp_seq = htons(seq); | 604 | outicmp->icmp_seq = htons(seq); |
602 | else | 605 | else |
603 | #endif | 606 | #endif |
604 | outudp->dest = htons(port + seq); | 607 | outudp->dest = htons(port + seq); |
605 | 608 | ||
606 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 609 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
607 | if (useicmp) { | 610 | if (useicmp) { |
608 | /* Always calculate checksum for icmp packets */ | 611 | /* Always calculate checksum for icmp packets */ |
609 | outicmp->icmp_cksum = 0; | 612 | outicmp->icmp_cksum = 0; |
@@ -631,7 +634,7 @@ send_probe(int seq, int ttl, struct timeval *tp) | |||
631 | *outip = tip; | 634 | *outip = tip; |
632 | } | 635 | } |
633 | 636 | ||
634 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 637 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
635 | /* XXX undocumented debugging hack */ | 638 | /* XXX undocumented debugging hack */ |
636 | if (verbose > 1) { | 639 | if (verbose > 1) { |
637 | const u_short *sp; | 640 | const u_short *sp; |
@@ -684,7 +687,7 @@ deltaT(struct timeval *t1p, struct timeval *t2p) | |||
684 | return dt; | 687 | return dt; |
685 | } | 688 | } |
686 | 689 | ||
687 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 690 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
688 | /* | 691 | /* |
689 | * Convert an ICMP "type" field to a printable string. | 692 | * Convert an ICMP "type" field to a printable string. |
690 | */ | 693 | */ |
@@ -717,7 +720,7 @@ packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) | |||
717 | ip = (struct ip *) buf; | 720 | ip = (struct ip *) buf; |
718 | hlen = ip->ip_hl << 2; | 721 | hlen = ip->ip_hl << 2; |
719 | if (cc < hlen + ICMP_MINLEN) { | 722 | if (cc < hlen + ICMP_MINLEN) { |
720 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 723 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
721 | if (verbose) | 724 | if (verbose) |
722 | printf("packet too short (%d bytes) from %s\n", cc, | 725 | printf("packet too short (%d bytes) from %s\n", cc, |
723 | inet_ntoa(from->sin_addr)); | 726 | inet_ntoa(from->sin_addr)); |
@@ -741,7 +744,7 @@ packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) | |||
741 | 744 | ||
742 | hip = &icp->icmp_ip; | 745 | hip = &icp->icmp_ip; |
743 | hlen = hip->ip_hl << 2; | 746 | hlen = hip->ip_hl << 2; |
744 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 747 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
745 | if (useicmp) { | 748 | if (useicmp) { |
746 | struct icmp *hicmp; | 749 | struct icmp *hicmp; |
747 | 750 | ||
@@ -770,7 +773,7 @@ packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) | |||
770 | return (type == ICMP_TIMXCEED ? -1 : code + 1); | 773 | return (type == ICMP_TIMXCEED ? -1 : code + 1); |
771 | } | 774 | } |
772 | } | 775 | } |
773 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 776 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
774 | if (verbose) { | 777 | if (verbose) { |
775 | int i; | 778 | int i; |
776 | u_int32_t *lp = (u_int32_t *)&icp->icmp_ip; | 779 | u_int32_t *lp = (u_int32_t *)&icp->icmp_ip; |
@@ -821,7 +824,7 @@ print(unsigned char *buf, int cc, struct sockaddr_in *from) | |||
821 | cc -= hlen; | 824 | cc -= hlen; |
822 | 825 | ||
823 | inetname(from); | 826 | inetname(from); |
824 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 827 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
825 | if (verbose) | 828 | if (verbose) |
826 | printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); | 829 | printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); |
827 | #endif | 830 | #endif |
@@ -869,7 +872,7 @@ freehostinfo(struct hostinfo *hi) | |||
869 | free((char *)hi); | 872 | free((char *)hi); |
870 | } | 873 | } |
871 | 874 | ||
872 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 875 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
873 | static void | 876 | static void |
874 | getaddr(u_int32_t *ap, const char *host) | 877 | getaddr(u_int32_t *ap, const char *host) |
875 | { | 878 | { |
@@ -899,7 +902,7 @@ traceroute_main(int argc, char *argv[]) | |||
899 | char *source = NULL; | 902 | char *source = NULL; |
900 | unsigned long op; | 903 | unsigned long op; |
901 | 904 | ||
902 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 905 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
903 | int lsrr = 0; | 906 | int lsrr = 0; |
904 | #endif | 907 | #endif |
905 | u_short off = 0; | 908 | u_short off = 0; |
@@ -915,12 +918,12 @@ traceroute_main(int argc, char *argv[]) | |||
915 | char *pausemsecs_str = NULL; | 918 | char *pausemsecs_str = NULL; |
916 | int first_ttl = 1; | 919 | int first_ttl = 1; |
917 | char *first_ttl_str = NULL; | 920 | char *first_ttl_str = NULL; |
918 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 921 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
919 | llist_t *sourse_route_list = NULL; | 922 | llist_t *sourse_route_list = NULL; |
920 | #endif | 923 | #endif |
921 | 924 | ||
922 | opterr = 0; | 925 | opterr = 0; |
923 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 926 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
924 | opt_complementary = "x-x:g::"; | 927 | opt_complementary = "x-x:g::"; |
925 | #else | 928 | #else |
926 | opt_complementary = "x-x"; | 929 | opt_complementary = "x-x"; |
@@ -936,23 +939,23 @@ traceroute_main(int argc, char *argv[]) | |||
936 | #define USAGE_OP_VERBOSE (1<<6) /* v */ | 939 | #define USAGE_OP_VERBOSE (1<<6) /* v */ |
937 | #define USAGE_OP_IP_CHKSUM (1<<7) /* x */ | 940 | #define USAGE_OP_IP_CHKSUM (1<<7) /* x */ |
938 | 941 | ||
939 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 942 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
940 | "g:" | 943 | "g:" |
941 | #endif | 944 | #endif |
942 | , &tos_str, &device, &max_ttl_str, &port_str, &nprobes_str, | 945 | , &tos_str, &device, &max_ttl_str, &port_str, &nprobes_str, |
943 | &source, &waittime_str, &pausemsecs_str, &first_ttl_str | 946 | &source, &waittime_str, &pausemsecs_str, &first_ttl_str |
944 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 947 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
945 | , &sourse_route_list | 948 | , &sourse_route_list |
946 | #endif | 949 | #endif |
947 | ); | 950 | ); |
948 | 951 | ||
949 | if (op & USAGE_OP_DONT_FRAGMNT) | 952 | if (op & USAGE_OP_DONT_FRAGMNT) |
950 | off = IP_DF; | 953 | off = IP_DF; |
951 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 954 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
952 | useicmp = op & USAGE_OP_USE_ICMP; | 955 | useicmp = op & USAGE_OP_USE_ICMP; |
953 | #endif | 956 | #endif |
954 | nflag = op & USAGE_OP_ADDR_NUM; | 957 | nflag = op & USAGE_OP_ADDR_NUM; |
955 | #ifdef CONFIG_FEATURE_TRACEROUTE_VERBOSE | 958 | #if ENABLE_FEATURE_TRACEROUTE_VERBOSE |
956 | verbose = op & USAGE_OP_VERBOSE; | 959 | verbose = op & USAGE_OP_VERBOSE; |
957 | #endif | 960 | #endif |
958 | if (op & USAGE_OP_IP_CHKSUM) { | 961 | if (op & USAGE_OP_IP_CHKSUM) { |
@@ -981,7 +984,7 @@ traceroute_main(int argc, char *argv[]) | |||
981 | if (first_ttl_str) | 984 | if (first_ttl_str) |
982 | first_ttl = xatoul_range(first_ttl_str, 1, 255); | 985 | first_ttl = xatoul_range(first_ttl_str, 1, 255); |
983 | 986 | ||
984 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 987 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
985 | if (sourse_route_list) { | 988 | if (sourse_route_list) { |
986 | llist_t *l_sr; | 989 | llist_t *l_sr; |
987 | 990 | ||
@@ -1006,7 +1009,7 @@ traceroute_main(int argc, char *argv[]) | |||
1006 | 1009 | ||
1007 | minpacket = sizeof(*outip) + sizeof(*outdata) + optlen; | 1010 | minpacket = sizeof(*outip) + sizeof(*outdata) + optlen; |
1008 | 1011 | ||
1009 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 1012 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
1010 | if (useicmp) | 1013 | if (useicmp) |
1011 | minpacket += 8; /* XXX magic number */ | 1014 | minpacket += 8; /* XXX magic number */ |
1012 | else | 1015 | else |
@@ -1044,7 +1047,7 @@ traceroute_main(int argc, char *argv[]) | |||
1044 | 1047 | ||
1045 | s = xsocket(AF_INET, SOCK_RAW, IPPROTO_ICMP); | 1048 | s = xsocket(AF_INET, SOCK_RAW, IPPROTO_ICMP); |
1046 | 1049 | ||
1047 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG | 1050 | #if TRACEROUTE_SO_DEBUG |
1048 | if (op & USAGE_OP_DEBUG) | 1051 | if (op & USAGE_OP_DEBUG) |
1049 | (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&on, | 1052 | (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&on, |
1050 | sizeof(on)); | 1053 | sizeof(on)); |
@@ -1055,7 +1058,7 @@ traceroute_main(int argc, char *argv[]) | |||
1055 | 1058 | ||
1056 | sndsock = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW); | 1059 | sndsock = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW); |
1057 | 1060 | ||
1058 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 1061 | #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE |
1059 | #if defined(IP_OPTIONS) | 1062 | #if defined(IP_OPTIONS) |
1060 | if (lsrr > 0) { | 1063 | if (lsrr > 0) { |
1061 | unsigned char optlist[MAX_IPOPTLEN]; | 1064 | unsigned char optlist[MAX_IPOPTLEN]; |
@@ -1101,7 +1104,7 @@ traceroute_main(int argc, char *argv[]) | |||
1101 | } | 1104 | } |
1102 | #endif | 1105 | #endif |
1103 | #endif | 1106 | #endif |
1104 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG | 1107 | #if TRACEROUTE_SO_DEBUG |
1105 | if (op & USAGE_OP_DEBUG) | 1108 | if (op & USAGE_OP_DEBUG) |
1106 | (void)setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (char *)&on, | 1109 | (void)setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (char *)&on, |
1107 | sizeof(on)); | 1110 | sizeof(on)); |
@@ -1126,7 +1129,7 @@ traceroute_main(int argc, char *argv[]) | |||
1126 | 1129 | ||
1127 | outip->ip_hl = (outp - (unsigned char *)outip) >> 2; | 1130 | outip->ip_hl = (outp - (unsigned char *)outip) >> 2; |
1128 | ident = (getpid() & 0xffff) | 0x8000; | 1131 | ident = (getpid() & 0xffff) | 0x8000; |
1129 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 1132 | #if ENABLE_FEATURE_TRACEROUTE_USE_ICMP |
1130 | if (useicmp) { | 1133 | if (useicmp) { |
1131 | outip->ip_p = IPPROTO_ICMP; | 1134 | outip->ip_p = IPPROTO_ICMP; |
1132 | 1135 | ||
diff --git a/networking/udhcp/static_leases.c b/networking/udhcp/static_leases.c index b53eac5a4..aabfb81aa 100644 --- a/networking/udhcp/static_leases.c +++ b/networking/udhcp/static_leases.c | |||
@@ -79,7 +79,7 @@ uint32_t reservedIp(struct static_lease *lease_struct, uint32_t ip) | |||
79 | return return_val; | 79 | return return_val; |
80 | } | 80 | } |
81 | 81 | ||
82 | #ifdef CONFIG_FEATURE_UDHCP_DEBUG | 82 | #if ENABLE_FEATURE_UDHCP_DEBUG |
83 | /* Print out static leases just to check what's going on */ | 83 | /* Print out static leases just to check what's going on */ |
84 | /* Takes the address of the pointer to the static_leases linked list */ | 84 | /* Takes the address of the pointer to the static_leases linked list */ |
85 | void printStaticLeases(struct static_lease **arg) | 85 | void printStaticLeases(struct static_lease **arg) |
diff --git a/networking/zcip.c b/networking/zcip.c index 6bd7f255b..27e281c93 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
@@ -24,14 +24,9 @@ | |||
24 | // - link status monitoring (restart on link-up; stop on link-down) | 24 | // - link status monitoring (restart on link-up; stop on link-down) |
25 | 25 | ||
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | #include <errno.h> | ||
28 | #include <string.h> | ||
29 | #include <syslog.h> | 27 | #include <syslog.h> |
30 | #include <poll.h> | 28 | #include <poll.h> |
31 | #include <time.h> | ||
32 | |||
33 | #include <sys/wait.h> | 29 | #include <sys/wait.h> |
34 | |||
35 | #include <netinet/ether.h> | 30 | #include <netinet/ether.h> |
36 | #include <net/ethernet.h> | 31 | #include <net/ethernet.h> |
37 | #include <net/if.h> | 32 | #include <net/if.h> |