diff options
author | Tim Riker <tim@rikers.org> | 2006-01-25 00:08:53 +0000 |
---|---|---|
committer | Tim Riker <tim@rikers.org> | 2006-01-25 00:08:53 +0000 |
commit | c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4 (patch) | |
tree | 5f329b7d0c7f20ecced0dc7581a9ba6dc720d965 /networking | |
parent | f64ff682a3d58dbb627e760e6fe1ec21d9ccdf61 (diff) | |
download | busybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.gz busybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.bz2 busybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.zip |
just whitespace
Diffstat (limited to 'networking')
37 files changed, 204 insertions, 204 deletions
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 9ea5c0366..7d5f79b6a 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c | |||
@@ -14,53 +14,53 @@ | |||
14 | /* full usage according Donald Becker | 14 | /* full usage according Donald Becker |
15 | * usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" | 15 | * usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" |
16 | * | 16 | * |
17 | * This program generates and transmits a Wake-On-LAN (WOL)\n" | 17 | * This program generates and transmits a Wake-On-LAN (WOL)\n" |
18 | * \"Magic Packet\", used for restarting machines that have been\n" | 18 | * \"Magic Packet\", used for restarting machines that have been\n" |
19 | * soft-powered-down (ACPI D3-warm state).\n" | 19 | * soft-powered-down (ACPI D3-warm state).\n" |
20 | * It currently generates the standard AMD Magic Packet format, with\n" | 20 | * It currently generates the standard AMD Magic Packet format, with\n" |
21 | * an optional password appended.\n" | 21 | * an optional password appended.\n" |
22 | * | 22 | * |
23 | * The single required parameter is the Ethernet MAC (station) address\n" | 23 | * The single required parameter is the Ethernet MAC (station) address\n" |
24 | * of the machine to wake or a host ID with known NSS 'ethers' entry.\n" | 24 | * of the machine to wake or a host ID with known NSS 'ethers' entry.\n" |
25 | * The MAC address may be found with the 'arp' program while the target\n" | 25 | * The MAC address may be found with the 'arp' program while the target\n" |
26 | * machine is awake.\n" | 26 | * machine is awake.\n" |
27 | * | 27 | * |
28 | * Options:\n" | 28 | * Options:\n" |
29 | * -b Send wake-up packet to the broadcast address.\n" | 29 | * -b Send wake-up packet to the broadcast address.\n" |
30 | * -D Increase the debug level.\n" | 30 | * -D Increase the debug level.\n" |
31 | * -i ifname Use interface IFNAME instead of the default 'eth0'.\n" | 31 | * -i ifname Use interface IFNAME instead of the default 'eth0'.\n" |
32 | * -p <pw> Append the four or six byte password PW to the packet.\n" | 32 | * -p <pw> Append the four or six byte password PW to the packet.\n" |
33 | * A password is only required for a few adapter types.\n" | 33 | * A password is only required for a few adapter types.\n" |
34 | * The password may be specified in ethernet hex format\n" | 34 | * The password may be specified in ethernet hex format\n" |
35 | * or dotted decimal (Internet address)\n" | 35 | * or dotted decimal (Internet address)\n" |
36 | * -p 00:22:44:66:88:aa\n" | 36 | * -p 00:22:44:66:88:aa\n" |
37 | * -p 192.168.1.1\n"; | 37 | * -p 192.168.1.1\n"; |
38 | * | 38 | * |
39 | * | ||
40 | * This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet", | ||
41 | * used for restarting machines that have been soft-powered-down | ||
42 | * (ACPI D3-warm state). It currently generates the standard AMD Magic Packet | ||
43 | * format, with an optional password appended. | ||
44 | * | ||
45 | * This software may be used and distributed according to the terms | ||
46 | * of the GNU Public License, incorporated herein by reference. | ||
47 | * Contact the author for use under other terms. | ||
48 | * | ||
49 | * This source file was originally part of the network tricks package, and | ||
50 | * is now distributed to support the Scyld Beowulf system. | ||
51 | * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. | ||
52 | * | ||
53 | * The author may be reached as becker@scyld, or C/O | ||
54 | * Scyld Computing Corporation | ||
55 | * 914 Bay Ridge Road, Suite 220 | ||
56 | * Annapolis MD 21403 | ||
39 | * | 57 | * |
40 | * This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet", | ||
41 | * used for restarting machines that have been soft-powered-down | ||
42 | * (ACPI D3-warm state). It currently generates the standard AMD Magic Packet | ||
43 | * format, with an optional password appended. | ||
44 | * | ||
45 | * This software may be used and distributed according to the terms | ||
46 | * of the GNU Public License, incorporated herein by reference. | ||
47 | * Contact the author for use under other terms. | ||
48 | * | ||
49 | * This source file was originally part of the network tricks package, and | ||
50 | * is now distributed to support the Scyld Beowulf system. | ||
51 | * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. | ||
52 | * | ||
53 | * The author may be reached as becker@scyld, or C/O | ||
54 | * Scyld Computing Corporation | ||
55 | * 914 Bay Ridge Road, Suite 220 | ||
56 | * Annapolis MD 21403 | ||
57 | * | ||
58 | * Notes: | 58 | * Notes: |
59 | * On some systems dropping root capability allows the process to be | 59 | * On some systems dropping root capability allows the process to be |
60 | * dumped, traced or debugged. | 60 | * dumped, traced or debugged. |
61 | * If someone traces this program, they get control of a raw socket. | 61 | * If someone traces this program, they get control of a raw socket. |
62 | * Linux handles this safely, but beware when porting this program. | 62 | * Linux handles this safely, but beware when porting this program. |
63 | * | 63 | * |
64 | * An alternative to needing 'root' is using a UDP broadcast socket, however | 64 | * An alternative to needing 'root' is using a UDP broadcast socket, however |
65 | * doing so only works with adapters configured for unicast+broadcast Rx | 65 | * doing so only works with adapters configured for unicast+broadcast Rx |
66 | * filter. That configuration consumes more power. | 66 | * filter. That configuration consumes more power. |
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c index 40d5cf1b7..c7fb42fc4 100644 --- a/networking/fakeidentd.c +++ b/networking/fakeidentd.c | |||
@@ -55,7 +55,7 @@ static const int ident_substr_len = sizeof(ident_substr) - 1; | |||
55 | #define PIDFILE "/var/run/identd.pid" | 55 | #define PIDFILE "/var/run/identd.pid" |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * We have to track the 'first connection socket' so that we | 58 | * We have to track the 'first connection socket' so that we |
59 | * don't go around closing file descriptors for non-clients. | 59 | * don't go around closing file descriptors for non-clients. |
60 | * | 60 | * |
61 | * descriptor setup normally | 61 | * descriptor setup normally |
diff --git a/networking/hostname.c b/networking/hostname.c index a00263d8f..8b9314c98 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -77,8 +77,8 @@ int hostname_main(int argc, char **argv) | |||
77 | if (argc < 1) | 77 | if (argc < 1) |
78 | bb_show_usage(); | 78 | bb_show_usage(); |
79 | 79 | ||
80 | while ((opt = getopt(argc, argv, "dfisF:")) > 0) { | 80 | while ((opt = getopt(argc, argv, "dfisF:")) > 0) { |
81 | switch (opt) { | 81 | switch (opt) { |
82 | case 'd': | 82 | case 'd': |
83 | case 'f': | 83 | case 'f': |
84 | case 'i': | 84 | case 'i': |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 9dce445bd..34a43e6fa 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -471,8 +471,8 @@ static int static_up(struct interface_defn_t *ifd, execfn *exec) | |||
471 | return ((result == 3) ? 3 : 0); | 471 | return ((result == 3) ? 3 : 0); |
472 | #else | 472 | #else |
473 | result = execute("ifconfig %iface% %address% netmask %netmask% " | 473 | result = execute("ifconfig %iface% %address% netmask %netmask% " |
474 | "[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] " | 474 | "[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] " |
475 | "[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up", | 475 | "[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up", |
476 | ifd, exec); | 476 | ifd, exec); |
477 | result += execute("[[ route add default gw %gateway% %iface% ]]", ifd, exec); | 477 | result += execute("[[ route add default gw %gateway% %iface% ]]", ifd, exec); |
478 | return ((result == 2) ? 2 : 0); | 478 | return ((result == 2) ? 2 : 0); |
diff --git a/networking/inetd.c b/networking/inetd.c index 7a6ffae0c..9f6acdb98 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -1364,7 +1364,7 @@ inetd_main (int argc, char *argv[]) | |||
1364 | sigaction (SIGINT, &sa, NULL); | 1364 | sigaction (SIGINT, &sa, NULL); |
1365 | sa.sa_handler = SIG_IGN; | 1365 | sa.sa_handler = SIG_IGN; |
1366 | sigaction (SIGPIPE, &sa, &sapipe); | 1366 | sigaction (SIGPIPE, &sa, &sapipe); |
1367 | memset(&wait_mask, 0, sizeof(wait_mask)); | 1367 | memset(&wait_mask, 0, sizeof(wait_mask)); |
1368 | { | 1368 | { |
1369 | /* space for daemons to overwrite environment for ps */ | 1369 | /* space for daemons to overwrite environment for ps */ |
1370 | #define DUMMYSIZE 100 | 1370 | #define DUMMYSIZE 100 |
diff --git a/networking/interface.c b/networking/interface.c index 554dc16d0..ad6c40fc1 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
@@ -1039,9 +1039,9 @@ static char *get_name(char *name, char *p) | |||
1039 | * args. */ | 1039 | * args. */ |
1040 | 1040 | ||
1041 | /* static const char * const ss_fmt[] = { */ | 1041 | /* static const char * const ss_fmt[] = { */ |
1042 | /* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */ | 1042 | /* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */ |
1043 | /* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */ | 1043 | /* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */ |
1044 | /* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */ | 1044 | /* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */ |
1045 | /* }; */ | 1045 | /* }; */ |
1046 | 1046 | ||
1047 | /* Lie about the size of the int pointed to for %n. */ | 1047 | /* Lie about the size of the int pointed to for %n. */ |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index c6115b356..c5e6e4ea5 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -54,8 +54,8 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown) | |||
54 | fprintf(fp, "<"); | 54 | fprintf(fp, "<"); |
55 | flags &= ~IFF_RUNNING; | 55 | flags &= ~IFF_RUNNING; |
56 | #define _PF(f) if (flags&IFF_##f) { \ | 56 | #define _PF(f) if (flags&IFF_##f) { \ |
57 | flags &= ~IFF_##f ; \ | 57 | flags &= ~IFF_##f ; \ |
58 | fprintf(fp, #f "%s", flags ? "," : ""); } | 58 | fprintf(fp, #f "%s", flags ? "," : ""); } |
59 | _PF(LOOPBACK); | 59 | _PF(LOOPBACK); |
60 | _PF(BROADCAST); | 60 | _PF(BROADCAST); |
61 | _PF(POINTOPOINT); | 61 | _PF(POINTOPOINT); |
@@ -74,7 +74,7 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown) | |||
74 | #endif | 74 | #endif |
75 | _PF(UP); | 75 | _PF(UP); |
76 | #undef _PF | 76 | #undef _PF |
77 | if (flags) | 77 | if (flags) |
78 | fprintf(fp, "%x", flags); | 78 | fprintf(fp, "%x", flags); |
79 | if (mdown) | 79 | if (mdown) |
80 | fprintf(fp, ",M-DOWN"); | 80 | fprintf(fp, ",M-DOWN"); |
@@ -636,9 +636,9 @@ static int ipaddr_modify(int cmd, int argc, char **argv) | |||
636 | "anycast", "scope", "dev", "label", "local", 0 }; | 636 | "anycast", "scope", "dev", "label", "local", 0 }; |
637 | struct rtnl_handle rth; | 637 | struct rtnl_handle rth; |
638 | struct { | 638 | struct { |
639 | struct nlmsghdr n; | 639 | struct nlmsghdr n; |
640 | struct ifaddrmsg ifa; | 640 | struct ifaddrmsg ifa; |
641 | char buf[256]; | 641 | char buf[256]; |
642 | } req; | 642 | } req; |
643 | char *d = NULL; | 643 | char *d = NULL; |
644 | char *l = NULL; | 644 | char *l = NULL; |
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index b4493d67d..91c85820c 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c | |||
@@ -289,7 +289,7 @@ static int do_set(int argc, char **argv) | |||
289 | NEXT_ARG(); | 289 | NEXT_ARG(); |
290 | newaddr = *argv; | 290 | newaddr = *argv; |
291 | } else { | 291 | } else { |
292 | if (strcmp(*argv, "dev") == 0) { | 292 | if (strcmp(*argv, "dev") == 0) { |
293 | NEXT_ARG(); | 293 | NEXT_ARG(); |
294 | } | 294 | } |
295 | if (dev) | 295 | if (dev) |
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index b622afd47..1c4f75520 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -286,9 +286,9 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv) | |||
286 | { | 286 | { |
287 | struct rtnl_handle rth; | 287 | struct rtnl_handle rth; |
288 | struct { | 288 | struct { |
289 | struct nlmsghdr n; | 289 | struct nlmsghdr n; |
290 | struct rtmsg r; | 290 | struct rtmsg r; |
291 | char buf[1024]; | 291 | char buf[1024]; |
292 | } req; | 292 | } req; |
293 | char mxbuf[256]; | 293 | char mxbuf[256]; |
294 | struct rtattr * mxrta = (void*)mxbuf; | 294 | struct rtattr * mxrta = (void*)mxbuf; |
@@ -648,15 +648,15 @@ static int iproute_get(int argc, char **argv) | |||
648 | { | 648 | { |
649 | struct rtnl_handle rth; | 649 | struct rtnl_handle rth; |
650 | struct { | 650 | struct { |
651 | struct nlmsghdr n; | 651 | struct nlmsghdr n; |
652 | struct rtmsg r; | 652 | struct rtmsg r; |
653 | char buf[1024]; | 653 | char buf[1024]; |
654 | } req; | 654 | } req; |
655 | char *idev = NULL; | 655 | char *idev = NULL; |
656 | char *odev = NULL; | 656 | char *odev = NULL; |
657 | int connected = 0; | 657 | int connected = 0; |
658 | int from_ok = 0; | 658 | int from_ok = 0; |
659 | static const char * const options[] = | 659 | static const char * const options[] = |
660 | { "from", "iif", "oif", "dev", "notify", "connected", "to", 0 }; | 660 | { "from", "iif", "oif", "dev", "notify", "connected", "to", 0 }; |
661 | 661 | ||
662 | memset(&req, 0, sizeof(req)); | 662 | memset(&req, 0, sizeof(req)); |
@@ -816,8 +816,8 @@ static int iproute_get(int argc, char **argv) | |||
816 | 816 | ||
817 | int do_iproute(int argc, char **argv) | 817 | int do_iproute(int argc, char **argv) |
818 | { | 818 | { |
819 | static const char * const ip_route_commands[] = | 819 | static const char * const ip_route_commands[] = |
820 | { "add", "append", "change", "chg", "delete", "del", "get", | 820 | { "add", "append", "change", "chg", "delete", "del", "get", |
821 | "list", "show", "prepend", "replace", "test", "flush", 0 }; | 821 | "list", "show", "prepend", "replace", "test", "flush", 0 }; |
822 | int command_num = 7; | 822 | int command_num = 7; |
823 | unsigned int flags = 0; | 823 | unsigned int flags = 0; |
diff --git a/networking/libiproute/linux/pkt_sched.h b/networking/libiproute/linux/pkt_sched.h index 70cbabc26..ec5b3fddd 100644 --- a/networking/libiproute/linux/pkt_sched.h +++ b/networking/libiproute/linux/pkt_sched.h | |||
@@ -256,8 +256,8 @@ struct tc_gred_sopt | |||
256 | 256 | ||
257 | struct tc_htb_opt | 257 | struct tc_htb_opt |
258 | { | 258 | { |
259 | struct tc_ratespec rate; | 259 | struct tc_ratespec rate; |
260 | struct tc_ratespec ceil; | 260 | struct tc_ratespec ceil; |
261 | __u32 buffer; | 261 | __u32 buffer; |
262 | __u32 cbuffer; | 262 | __u32 cbuffer; |
263 | __u32 quantum; /* out only */ | 263 | __u32 quantum; /* out only */ |
@@ -268,9 +268,9 @@ struct tc_htb_opt | |||
268 | }; | 268 | }; |
269 | struct tc_htb_glob | 269 | struct tc_htb_glob |
270 | { | 270 | { |
271 | __u32 rate2quantum; /* bps->quantum divisor */ | 271 | __u32 rate2quantum; /* bps->quantum divisor */ |
272 | __u32 defcls; /* default class number */ | 272 | __u32 defcls; /* default class number */ |
273 | __u32 use_dcache; /* use dequeue cache ? */ | 273 | __u32 use_dcache; /* use dequeue cache ? */ |
274 | __u32 debug; /* debug flags */ | 274 | __u32 debug; /* debug flags */ |
275 | 275 | ||
276 | 276 | ||
@@ -311,8 +311,8 @@ struct tc_cbq_lssopt | |||
311 | unsigned char flags; | 311 | unsigned char flags; |
312 | #define TCF_CBQ_LSS_BOUNDED 1 | 312 | #define TCF_CBQ_LSS_BOUNDED 1 |
313 | #define TCF_CBQ_LSS_ISOLATED 2 | 313 | #define TCF_CBQ_LSS_ISOLATED 2 |
314 | unsigned char ewma_log; | 314 | unsigned char ewma_log; |
315 | unsigned char level; | 315 | unsigned char level; |
316 | #define TCF_CBQ_LSS_FLAGS 1 | 316 | #define TCF_CBQ_LSS_FLAGS 1 |
317 | #define TCF_CBQ_LSS_EWMA 2 | 317 | #define TCF_CBQ_LSS_EWMA 2 |
318 | #define TCF_CBQ_LSS_MAXIDLE 4 | 318 | #define TCF_CBQ_LSS_MAXIDLE 4 |
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c index 104fbca25..873253050 100644 --- a/networking/libiproute/ll_proto.c +++ b/networking/libiproute/ll_proto.c | |||
@@ -92,23 +92,23 @@ __PF(ECONET,econet) | |||
92 | 92 | ||
93 | const char * ll_proto_n2a(unsigned short id, char *buf, int len) | 93 | const char * ll_proto_n2a(unsigned short id, char *buf, int len) |
94 | { | 94 | { |
95 | int i; | 95 | int i; |
96 | 96 | ||
97 | id = ntohs(id); | 97 | id = ntohs(id); |
98 | 98 | ||
99 | for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { | 99 | for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { |
100 | if (llproto_names[i].id == id) | 100 | if (llproto_names[i].id == id) |
101 | return llproto_names[i].name; | 101 | return llproto_names[i].name; |
102 | } | 102 | } |
103 | snprintf(buf, len, "[%d]", id); | 103 | snprintf(buf, len, "[%d]", id); |
104 | return buf; | 104 | return buf; |
105 | } | 105 | } |
106 | 106 | ||
107 | int ll_proto_a2n(unsigned short *id, char *buf) | 107 | int ll_proto_a2n(unsigned short *id, char *buf) |
108 | { | 108 | { |
109 | int i; | 109 | int i; |
110 | for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { | 110 | for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { |
111 | if (strcasecmp(llproto_names[i].name, buf) == 0) { | 111 | if (strcasecmp(llproto_names[i].name, buf) == 0) { |
112 | *id = htons(llproto_names[i].id); | 112 | *id = htons(llproto_names[i].id); |
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c index 6b42426d5..fc5a01530 100644 --- a/networking/libiproute/ll_types.c +++ b/networking/libiproute/ll_types.c | |||
@@ -105,11 +105,11 @@ __PF(VOID,void) | |||
105 | }; | 105 | }; |
106 | #undef __PF | 106 | #undef __PF |
107 | 107 | ||
108 | int i; | 108 | int i; |
109 | for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { | 109 | for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { |
110 | if (arphrd_names[i].type == type) | 110 | if (arphrd_names[i].type == type) |
111 | return arphrd_names[i].name; | 111 | return arphrd_names[i].name; |
112 | } | 112 | } |
113 | snprintf(buf, len, "[%d]", type); | 113 | snprintf(buf, len, "[%d]", type); |
114 | return buf; | 114 | return buf; |
115 | } | 115 | } |
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index 3d223edf6..0a3a06c15 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h | |||
@@ -46,8 +46,8 @@ typedef struct | |||
46 | 46 | ||
47 | struct dn_naddr | 47 | struct dn_naddr |
48 | { | 48 | { |
49 | unsigned short a_len; | 49 | unsigned short a_len; |
50 | unsigned char a_addr[DN_MAXADDL]; | 50 | unsigned char a_addr[DN_MAXADDL]; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | #define IPX_NODE_LEN 6 | 53 | #define IPX_NODE_LEN 6 |
diff --git a/networking/nc.c b/networking/nc.c index fda1fb8f6..85148c4a7 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -48,9 +48,9 @@ static void timeout(int signum) | |||
48 | int nc_main(int argc, char **argv) | 48 | int nc_main(int argc, char **argv) |
49 | { | 49 | { |
50 | int do_listen = 0, lport = 0, delay = 0, wsecs = 0, tmpfd, opt, sfd, x; | 50 | int do_listen = 0, lport = 0, delay = 0, wsecs = 0, tmpfd, opt, sfd, x; |
51 | 51 | ||
52 | #define buf bb_common_bufsiz1 | 52 | #define buf bb_common_bufsiz1 |
53 | 53 | ||
54 | #ifdef CONFIG_NC_GAPING_SECURITY_HOLE | 54 | #ifdef CONFIG_NC_GAPING_SECURITY_HOLE |
55 | char *pr00gie = NULL; | 55 | char *pr00gie = NULL; |
56 | #endif | 56 | #endif |
diff --git a/networking/netstat.c b/networking/netstat.c index bc1ed057b..ea372322f 100644 --- a/networking/netstat.c +++ b/networking/netstat.c | |||
@@ -247,7 +247,7 @@ static void udp_do_one(int lnr, const char *line) | |||
247 | 247 | ||
248 | if (strlen(local_addr) > 8) { | 248 | if (strlen(local_addr) > 8) { |
249 | #ifdef CONFIG_FEATURE_IPV6 | 249 | #ifdef CONFIG_FEATURE_IPV6 |
250 | /* Demangle what the kernel gives us */ | 250 | /* Demangle what the kernel gives us */ |
251 | sscanf(local_addr, "%08X%08X%08X%08X", | 251 | sscanf(local_addr, "%08X%08X%08X%08X", |
252 | &in6.s6_addr32[0], &in6.s6_addr32[1], | 252 | &in6.s6_addr32[0], &in6.s6_addr32[1], |
253 | &in6.s6_addr32[2], &in6.s6_addr32[3]); | 253 | &in6.s6_addr32[2], &in6.s6_addr32[3]); |
diff --git a/networking/ping.c b/networking/ping.c index ed52abf04..14373c8d6 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -236,20 +236,20 @@ static void sendping(int junk) | |||
236 | static char *icmp_type_name (int id) | 236 | static char *icmp_type_name (int id) |
237 | { | 237 | { |
238 | switch (id) { | 238 | switch (id) { |
239 | case ICMP_ECHOREPLY: return "Echo Reply"; | 239 | case ICMP_ECHOREPLY: return "Echo Reply"; |
240 | case ICMP_DEST_UNREACH: return "Destination Unreachable"; | 240 | case ICMP_DEST_UNREACH: return "Destination Unreachable"; |
241 | case ICMP_SOURCE_QUENCH: return "Source Quench"; | 241 | case ICMP_SOURCE_QUENCH: return "Source Quench"; |
242 | case ICMP_REDIRECT: return "Redirect (change route)"; | 242 | case ICMP_REDIRECT: return "Redirect (change route)"; |
243 | case ICMP_ECHO: return "Echo Request"; | 243 | case ICMP_ECHO: return "Echo Request"; |
244 | case ICMP_TIME_EXCEEDED: return "Time Exceeded"; | 244 | case ICMP_TIME_EXCEEDED: return "Time Exceeded"; |
245 | case ICMP_PARAMETERPROB: return "Parameter Problem"; | 245 | case ICMP_PARAMETERPROB: return "Parameter Problem"; |
246 | case ICMP_TIMESTAMP: return "Timestamp Request"; | 246 | case ICMP_TIMESTAMP: return "Timestamp Request"; |
247 | case ICMP_TIMESTAMPREPLY: return "Timestamp Reply"; | 247 | case ICMP_TIMESTAMPREPLY: return "Timestamp Reply"; |
248 | case ICMP_INFO_REQUEST: return "Information Request"; | 248 | case ICMP_INFO_REQUEST: return "Information Request"; |
249 | case ICMP_INFO_REPLY: return "Information Reply"; | 249 | case ICMP_INFO_REPLY: return "Information Reply"; |
250 | case ICMP_ADDRESS: return "Address Mask Request"; | 250 | case ICMP_ADDRESS: return "Address Mask Request"; |
251 | case ICMP_ADDRESSREPLY: return "Address Mask Reply"; | 251 | case ICMP_ADDRESSREPLY: return "Address Mask Reply"; |
252 | default: return "unknown ICMP type"; | 252 | default: return "unknown ICMP type"; |
253 | } | 253 | } |
254 | } | 254 | } |
255 | 255 | ||
diff --git a/networking/ping6.c b/networking/ping6.c index 72867f346..1d7271d7b 100644 --- a/networking/ping6.c +++ b/networking/ping6.c | |||
@@ -246,7 +246,7 @@ static char *icmp6_type_name (int id) | |||
246 | case ICMP6_MEMBERSHIP_QUERY: return "Membership Query"; | 246 | case ICMP6_MEMBERSHIP_QUERY: return "Membership Query"; |
247 | case ICMP6_MEMBERSHIP_REPORT: return "Membership Report"; | 247 | case ICMP6_MEMBERSHIP_REPORT: return "Membership Report"; |
248 | case ICMP6_MEMBERSHIP_REDUCTION: return "Membership Reduction"; | 248 | case ICMP6_MEMBERSHIP_REDUCTION: return "Membership Reduction"; |
249 | default: return "unknown ICMP type"; | 249 | default: return "unknown ICMP type"; |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
diff --git a/networking/route.c b/networking/route.c index bb5f9405b..49d219ae0 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -86,7 +86,7 @@ | |||
86 | /* We remap '-' to '#' to avoid problems with getopt. */ | 86 | /* We remap '-' to '#' to avoid problems with getopt. */ |
87 | static const char tbl_hash_net_host[] = | 87 | static const char tbl_hash_net_host[] = |
88 | "\007\001#net\0" | 88 | "\007\001#net\0" |
89 | /* "\010\002#host\0" */ | 89 | /* "\010\002#host\0" */ |
90 | "\007\002#host" /* Since last, we can save a byte. */ | 90 | "\007\002#host" /* Since last, we can save a byte. */ |
91 | ; | 91 | ; |
92 | 92 | ||
@@ -128,7 +128,7 @@ static const char tbl_ipvx[] = | |||
128 | #endif | 128 | #endif |
129 | "\006\041mod\0" | 129 | "\006\041mod\0" |
130 | "\006\042dyn\0" | 130 | "\006\042dyn\0" |
131 | /* "\014\043reinstate\0" */ | 131 | /* "\014\043reinstate\0" */ |
132 | "\013\043reinstate" /* Since last, we can save a byte. */ | 132 | "\013\043reinstate" /* Since last, we can save a byte. */ |
133 | ; | 133 | ; |
134 | 134 | ||
@@ -186,7 +186,7 @@ static void INET_setroute(int action, char **args) | |||
186 | const char *target = *args++; | 186 | const char *target = *args++; |
187 | 187 | ||
188 | /* Prefer hostname lookup is -host flag (xflag==1) was given. */ | 188 | /* Prefer hostname lookup is -host flag (xflag==1) was given. */ |
189 | isnet = INET_resolve(target, (struct sockaddr_in *) &rt.rt_dst, | 189 | isnet = INET_resolve(target, (struct sockaddr_in *) &rt.rt_dst, |
190 | (xflag & HOST_FLAG)); | 190 | (xflag & HOST_FLAG)); |
191 | if (isnet < 0) { | 191 | if (isnet < 0) { |
192 | bb_error_msg_and_die("resolving %s", target); | 192 | bb_error_msg_and_die("resolving %s", target); |
@@ -459,7 +459,7 @@ static const unsigned int flagvals[] = { /* Must agree with flagchars[]. */ | |||
459 | #define IPV4_MASK (RTF_GATEWAY|RTF_HOST|RTF_REINSTATE|RTF_DYNAMIC|RTF_MODIFIED) | 459 | #define IPV4_MASK (RTF_GATEWAY|RTF_HOST|RTF_REINSTATE|RTF_DYNAMIC|RTF_MODIFIED) |
460 | #define IPV6_MASK (RTF_GATEWAY|RTF_HOST|RTF_DEFAULT|RTF_ADDRCONF|RTF_CACHE) | 460 | #define IPV6_MASK (RTF_GATEWAY|RTF_HOST|RTF_DEFAULT|RTF_ADDRCONF|RTF_CACHE) |
461 | 461 | ||
462 | static const char flagchars[] = /* Must agree with flagvals[]. */ | 462 | static const char flagchars[] = /* Must agree with flagvals[]. */ |
463 | "GHRDM" | 463 | "GHRDM" |
464 | #ifdef CONFIG_FEATURE_IPV6 | 464 | #ifdef CONFIG_FEATURE_IPV6 |
465 | "DAC" | 465 | "DAC" |
@@ -645,10 +645,10 @@ static void INET6_displayroutes(int noresolve) | |||
645 | #define ROUTE_OPT_INET6 0x08 /* Not an actual option. See below. */ | 645 | #define ROUTE_OPT_INET6 0x08 /* Not an actual option. See below. */ |
646 | 646 | ||
647 | /* 1st byte is offset to next entry offset. 2nd byte is return value. */ | 647 | /* 1st byte is offset to next entry offset. 2nd byte is return value. */ |
648 | static const char tbl_verb[] = /* 2nd byte matches RTACTION_* code */ | 648 | static const char tbl_verb[] = /* 2nd byte matches RTACTION_* code */ |
649 | "\006\001add\0" | 649 | "\006\001add\0" |
650 | "\006\002del\0" | 650 | "\006\002del\0" |
651 | /* "\011\002delete\0" */ | 651 | /* "\011\002delete\0" */ |
652 | "\010\002delete" /* Since last, we can save a byte. */ | 652 | "\010\002delete" /* Since last, we can save a byte. */ |
653 | ; | 653 | ; |
654 | 654 | ||
diff --git a/networking/telnet.c b/networking/telnet.c index 314363188..d9e66e5d3 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -647,7 +647,7 @@ extern int telnet_main(int argc, char** argv) | |||
647 | #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN | 647 | #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN |
648 | if (1 & bb_getopt_ulflags(argc, argv, "al:", &autologin)) | 648 | if (1 & bb_getopt_ulflags(argc, argv, "al:", &autologin)) |
649 | autologin = getenv("USER"); | 649 | autologin = getenv("USER"); |
650 | 650 | ||
651 | if (optind < argc) { | 651 | if (optind < argc) { |
652 | bb_lookup_host(&s_in, argv[optind++]); | 652 | bb_lookup_host(&s_in, argv[optind++]); |
653 | s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] : | 653 | s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] : |
diff --git a/networking/telnetd.c b/networking/telnetd.c index d5de8903c..73303a20a 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -94,7 +94,7 @@ struct tsession { | |||
94 | +-------+ wridx1++ +------+ rdidx1++ +----------+ | 94 | +-------+ wridx1++ +------+ rdidx1++ +----------+ |
95 | | | <-------------- | buf1 | <-------------- | | | 95 | | | <-------------- | buf1 | <-------------- | | |
96 | | | size1-- +------+ size1++ | | | 96 | | | size1-- +------+ size1++ | | |
97 | | pty | | socket | | 97 | | pty | | socket | |
98 | | | rdidx2++ +------+ wridx2++ | | | 98 | | | rdidx2++ +------+ wridx2++ | | |
99 | | | --------------> | buf2 | --------------> | | | 99 | | | --------------> | buf2 | --------------> | | |
100 | +-------+ size2++ +------+ size2-- +----------+ | 100 | +-------+ size2++ +------+ size2-- +----------+ |
@@ -166,7 +166,7 @@ remove_iacs(struct tsession *ts, int *pnum_totty) { | |||
166 | else if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { | 166 | else if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { |
167 | struct winsize ws; | 167 | struct winsize ws; |
168 | if ((ptr+8) >= end) | 168 | if ((ptr+8) >= end) |
169 | break; /* incomplete, can't process */ | 169 | break; /* incomplete, can't process */ |
170 | ws.ws_col = (ptr[3] << 8) | ptr[4]; | 170 | ws.ws_col = (ptr[3] << 8) | ptr[4]; |
171 | ws.ws_row = (ptr[5] << 8) | ptr[6]; | 171 | ws.ws_row = (ptr[5] << 8) | ptr[6]; |
172 | (void) ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); | 172 | (void) ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); |
@@ -383,7 +383,7 @@ int | |||
383 | telnetd_main(int argc, char **argv) | 383 | telnetd_main(int argc, char **argv) |
384 | { | 384 | { |
385 | #ifndef CONFIG_FEATURE_TELNETD_INETD | 385 | #ifndef CONFIG_FEATURE_TELNETD_INETD |
386 | sockaddr_type sa; | 386 | sockaddr_type sa; |
387 | int master_fd; | 387 | int master_fd; |
388 | #endif /* CONFIG_FEATURE_TELNETD_INETD */ | 388 | #endif /* CONFIG_FEATURE_TELNETD_INETD */ |
389 | fd_set rdfdset, wrfdset; | 389 | fd_set rdfdset, wrfdset; |
@@ -446,7 +446,7 @@ telnetd_main(int argc, char **argv) | |||
446 | 446 | ||
447 | /* Grab a TCP socket. */ | 447 | /* Grab a TCP socket. */ |
448 | 448 | ||
449 | master_fd = socket(SOCKET_TYPE, SOCK_STREAM, 0); | 449 | master_fd = socket(SOCKET_TYPE, SOCK_STREAM, 0); |
450 | if (master_fd < 0) { | 450 | if (master_fd < 0) { |
451 | bb_perror_msg_and_die("socket"); | 451 | bb_perror_msg_and_die("socket"); |
452 | } | 452 | } |
diff --git a/networking/tftp.c b/networking/tftp.c index cad0dcc45..402d5d03c 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -1,34 +1,34 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | 1 | /* ------------------------------------------------------------------------- */ |
2 | /* tftp.c */ | 2 | /* tftp.c */ |
3 | /* */ | 3 | /* */ |
4 | /* A simple tftp client for busybox. */ | 4 | /* A simple tftp client for busybox. */ |
5 | /* Tries to follow RFC1350. */ | 5 | /* Tries to follow RFC1350. */ |
6 | /* Only "octet" mode supported. */ | 6 | /* Only "octet" mode supported. */ |
7 | /* Optional blocksize negotiation (RFC2347 + RFC2348) */ | 7 | /* Optional blocksize negotiation (RFC2347 + RFC2348) */ |
8 | /* */ | 8 | /* */ |
9 | /* Copyright (C) 2001 Magnus Damm <damm@opensource.se> */ | 9 | /* Copyright (C) 2001 Magnus Damm <damm@opensource.se> */ |
10 | /* */ | 10 | /* */ |
11 | /* Parts of the code based on: */ | 11 | /* Parts of the code based on: */ |
12 | /* */ | 12 | /* */ |
13 | /* atftp: Copyright (C) 2000 Jean-Pierre Lefebvre <helix@step.polymtl.ca> */ | 13 | /* atftp: Copyright (C) 2000 Jean-Pierre Lefebvre <helix@step.polymtl.ca> */ |
14 | /* and Remi Lefebvre <remi@debian.org> */ | 14 | /* and Remi Lefebvre <remi@debian.org> */ |
15 | /* */ | 15 | /* */ |
16 | /* utftp: Copyright (C) 1999 Uwe Ohse <uwe@ohse.de> */ | 16 | /* utftp: Copyright (C) 1999 Uwe Ohse <uwe@ohse.de> */ |
17 | /* */ | 17 | /* */ |
18 | /* This program is free software; you can redistribute it and/or modify */ | 18 | /* This program is free software; you can redistribute it and/or modify */ |
19 | /* it under the terms of the GNU General Public License as published by */ | 19 | /* it under the terms of the GNU General Public License as published by */ |
20 | /* the Free Software Foundation; either version 2 of the License, or */ | 20 | /* the Free Software Foundation; either version 2 of the License, or */ |
21 | /* (at your option) any later version. */ | 21 | /* (at your option) any later version. */ |
22 | /* */ | 22 | /* */ |
23 | /* This program is distributed in the hope that it will be useful, */ | 23 | /* This program is distributed in the hope that it will be useful, */ |
24 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | 24 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
25 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ | 25 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ |
26 | /* General Public License for more details. */ | 26 | /* General Public License for more details. */ |
27 | /* */ | 27 | /* */ |
28 | /* You should have received a copy of the GNU General Public License */ | 28 | /* You should have received a copy of the GNU General Public License */ |
29 | /* along with this program; if not, write to the Free Software */ | 29 | /* along with this program; if not, write to the Free Software */ |
30 | /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | 30 | /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
31 | /* */ | 31 | /* */ |
32 | /* ------------------------------------------------------------------------- */ | 32 | /* ------------------------------------------------------------------------- */ |
33 | 33 | ||
34 | #include <stdio.h> | 34 | #include <stdio.h> |
@@ -87,13 +87,13 @@ static const char * const tftp_bb_error_msg[] = { | |||
87 | 87 | ||
88 | static int tftp_blocksize_check(int blocksize, int bufsize) | 88 | static int tftp_blocksize_check(int blocksize, int bufsize) |
89 | { | 89 | { |
90 | /* Check if the blocksize is valid: | 90 | /* Check if the blocksize is valid: |
91 | * RFC2348 says between 8 and 65464, | 91 | * RFC2348 says between 8 and 65464, |
92 | * but our implementation makes it impossible | 92 | * but our implementation makes it impossible |
93 | * to use blocksizes smaller than 22 octets. | 93 | * to use blocksizes smaller than 22 octets. |
94 | */ | 94 | */ |
95 | 95 | ||
96 | if ((bufsize && (blocksize > bufsize)) || | 96 | if ((bufsize && (blocksize > bufsize)) || |
97 | (blocksize < 8) || (blocksize > 65464)) { | 97 | (blocksize < 8) || (blocksize > 65464)) { |
98 | bb_error_msg("bad blocksize"); | 98 | bb_error_msg("bad blocksize"); |
99 | return 0; | 99 | return 0; |
@@ -104,7 +104,7 @@ static int tftp_blocksize_check(int blocksize, int bufsize) | |||
104 | 104 | ||
105 | static char *tftp_option_get(char *buf, int len, char *option) | 105 | static char *tftp_option_get(char *buf, int len, char *option) |
106 | { | 106 | { |
107 | int opt_val = 0; | 107 | int opt_val = 0; |
108 | int opt_found = 0; | 108 | int opt_found = 0; |
109 | int k; | 109 | int k; |
110 | 110 | ||
@@ -216,7 +216,7 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
216 | 216 | ||
217 | if ((cmd_get && (opcode == TFTP_RRQ)) || | 217 | if ((cmd_get && (opcode == TFTP_RRQ)) || |
218 | (cmd_put && (opcode == TFTP_WRQ))) { | 218 | (cmd_put && (opcode == TFTP_WRQ))) { |
219 | int too_long = 0; | 219 | int too_long = 0; |
220 | 220 | ||
221 | /* see if the filename fits into buf */ | 221 | /* see if the filename fits into buf */ |
222 | /* and fill in packet */ | 222 | /* and fill in packet */ |
@@ -418,7 +418,7 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
418 | 418 | ||
419 | if (res) { | 419 | if (res) { |
420 | int blksize = atoi(res); | 420 | int blksize = atoi(res); |
421 | 421 | ||
422 | if (tftp_blocksize_check(blksize, | 422 | if (tftp_blocksize_check(blksize, |
423 | tftp_bufsize - 4)) { | 423 | tftp_bufsize - 4)) { |
424 | 424 | ||
@@ -452,7 +452,7 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
452 | if (cmd_get && (opcode == TFTP_DATA)) { | 452 | if (cmd_get && (opcode == TFTP_DATA)) { |
453 | 453 | ||
454 | if (tmp == block_nr) { | 454 | if (tmp == block_nr) { |
455 | 455 | ||
456 | len = bb_full_write(localfd, &buf[4], len - 4); | 456 | len = bb_full_write(localfd, &buf[4], len - 4); |
457 | 457 | ||
458 | if (len < 0) { | 458 | if (len < 0) { |
@@ -496,7 +496,7 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
496 | #ifdef CONFIG_FEATURE_CLEAN_UP | 496 | #ifdef CONFIG_FEATURE_CLEAN_UP |
497 | close(socketfd); | 497 | close(socketfd); |
498 | 498 | ||
499 | free(buf); | 499 | free(buf); |
500 | #endif | 500 | #endif |
501 | 501 | ||
502 | return finished ? EXIT_SUCCESS : EXIT_FAILURE; | 502 | return finished ? EXIT_SUCCESS : EXIT_FAILURE; |
@@ -549,8 +549,8 @@ int tftp_main(int argc, char **argv) | |||
549 | /* XXX: may be should #error ? */ | 549 | /* XXX: may be should #error ? */ |
550 | #endif | 550 | #endif |
551 | 551 | ||
552 | 552 | ||
553 | cmd = bb_getopt_ulflags(argc, argv, GET PUT "l:r:" BS, | 553 | cmd = bb_getopt_ulflags(argc, argv, GET PUT "l:r:" BS, |
554 | &localfile, &remotefile BS_ARG); | 554 | &localfile, &remotefile BS_ARG); |
555 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE | 555 | #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE |
556 | if(sblocksize) { | 556 | if(sblocksize) { |
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c index 7cc2be42e..4831d4371 100644 --- a/networking/udhcp/arpping.c +++ b/networking/udhcp/arpping.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * ip - our ip | 23 | * ip - our ip |
24 | * mac - our arp address | 24 | * mac - our arp address |
25 | * interface - interface to use | 25 | * interface - interface to use |
26 | * retn: 1 addr free | 26 | * retn: 1 addr free |
27 | * 0 addr used | 27 | * 0 addr used |
28 | * -1 error | 28 | * -1 error |
29 | */ | 29 | */ |
@@ -33,7 +33,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface) | |||
33 | { | 33 | { |
34 | 34 | ||
35 | int timeout = 2; | 35 | int timeout = 2; |
36 | int optval = 1; | 36 | int optval = 1; |
37 | int s; /* socket */ | 37 | int s; /* socket */ |
38 | int rv = 1; /* return value */ | 38 | int rv = 1; /* return value */ |
39 | struct sockaddr addr; /* for interface name */ | 39 | struct sockaddr addr; /* for interface name */ |
@@ -101,6 +101,6 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface) | |||
101 | prevTime = uptime(); | 101 | prevTime = uptime(); |
102 | } | 102 | } |
103 | close(s); | 103 | close(s); |
104 | DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V"); | 104 | DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V"); |
105 | return rv; | 105 | return rv; |
106 | } | 106 | } |
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c index 528befde6..e377bd236 100644 --- a/networking/udhcp/clientpacket.c +++ b/networking/udhcp/clientpacket.c | |||
@@ -205,8 +205,8 @@ int get_raw_packet(struct dhcpMessage *payload, int fd) | |||
205 | packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) || | 205 | packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) || |
206 | bytes > (int) sizeof(struct udp_dhcp_packet) || | 206 | bytes > (int) sizeof(struct udp_dhcp_packet) || |
207 | ntohs(packet.udp.len) != (uint16_t) (bytes - sizeof(packet.ip))) { | 207 | ntohs(packet.udp.len) != (uint16_t) (bytes - sizeof(packet.ip))) { |
208 | DEBUG(LOG_INFO, "unrelated/bogus packet"); | 208 | DEBUG(LOG_INFO, "unrelated/bogus packet"); |
209 | return -2; | 209 | return -2; |
210 | } | 210 | } |
211 | 211 | ||
212 | /* check IP checksum */ | 212 | /* check IP checksum */ |
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index efa8fd419..071a5c428 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -43,7 +43,7 @@ long uptime(void); | |||
43 | void background(const char *pidfile); | 43 | void background(const char *pidfile); |
44 | void start_log_and_pid(const char *client_server, const char *pidfile); | 44 | void start_log_and_pid(const char *client_server, const char *pidfile); |
45 | void udhcp_logging(int level, const char *fmt, ...); | 45 | void udhcp_logging(int level, const char *fmt, ...); |
46 | 46 | ||
47 | #define LOG(level, str, args...) udhcp_logging(level, str, ## args) | 47 | #define LOG(level, str, args...) udhcp_logging(level, str, ## args) |
48 | 48 | ||
49 | #ifdef UDHCP_DEBUG | 49 | #ifdef UDHCP_DEBUG |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index c4277e3f1..a4afb0c46 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -196,7 +196,7 @@ int main(int argc, char *argv[]) | |||
196 | {"hostname", required_argument, 0, 'h'}, | 196 | {"hostname", required_argument, 0, 'h'}, |
197 | {"fqdn", required_argument, 0, 'F'}, | 197 | {"fqdn", required_argument, 0, 'F'}, |
198 | {"interface", required_argument, 0, 'i'}, | 198 | {"interface", required_argument, 0, 'i'}, |
199 | {"now", no_argument, 0, 'n'}, | 199 | {"now", no_argument, 0, 'n'}, |
200 | {"pidfile", required_argument, 0, 'p'}, | 200 | {"pidfile", required_argument, 0, 'p'}, |
201 | {"quit", no_argument, 0, 'q'}, | 201 | {"quit", no_argument, 0, 'q'}, |
202 | {"request", required_argument, 0, 'r'}, | 202 | {"request", required_argument, 0, 'r'}, |
@@ -314,7 +314,7 @@ int main(int argc, char *argv[]) | |||
314 | client_config.vendorclass[OPT_CODE] = DHCP_VENDOR; | 314 | client_config.vendorclass[OPT_CODE] = DHCP_VENDOR; |
315 | client_config.vendorclass[OPT_LEN] = sizeof("udhcp "VERSION) - 1; | 315 | client_config.vendorclass[OPT_LEN] = sizeof("udhcp "VERSION) - 1; |
316 | client_config.vendorclass[OPT_DATA] = 1; | 316 | client_config.vendorclass[OPT_DATA] = 1; |
317 | memcpy(&client_config.vendorclass[OPT_DATA], | 317 | memcpy(&client_config.vendorclass[OPT_DATA], |
318 | "udhcp "VERSION, sizeof("udhcp "VERSION) - 1); | 318 | "udhcp "VERSION, sizeof("udhcp "VERSION) - 1); |
319 | } | 319 | } |
320 | 320 | ||
@@ -370,7 +370,7 @@ int main(int argc, char *argv[]) | |||
370 | } else if (client_config.abort_if_no_lease) { | 370 | } else if (client_config.abort_if_no_lease) { |
371 | LOG(LOG_INFO, "No lease, failing."); | 371 | LOG(LOG_INFO, "No lease, failing."); |
372 | return 1; | 372 | return 1; |
373 | } | 373 | } |
374 | /* wait to try again */ | 374 | /* wait to try again */ |
375 | packet_num = 0; | 375 | packet_num = 0; |
376 | timeout = now + 60; | 376 | timeout = now + 60; |
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 2812e6e8c..0dfc0b559 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -193,7 +193,7 @@ int main(int argc, char *argv[]) | |||
193 | LOG(LOG_ERR, "send OFFER failed"); | 193 | LOG(LOG_ERR, "send OFFER failed"); |
194 | } | 194 | } |
195 | break; | 195 | break; |
196 | case DHCPREQUEST: | 196 | case DHCPREQUEST: |
197 | DEBUG(LOG_INFO, "received REQUEST"); | 197 | DEBUG(LOG_INFO, "received REQUEST"); |
198 | 198 | ||
199 | requested = get_option(&packet, DHCP_REQUESTED_IP); | 199 | requested = get_option(&packet, DHCP_REQUESTED_IP); |
diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h index 65c8348bf..a060002cd 100644 --- a/networking/udhcp/dhcpd.h +++ b/networking/udhcp/dhcpd.h | |||
@@ -108,23 +108,23 @@ struct static_lease { | |||
108 | 108 | ||
109 | struct server_config_t { | 109 | struct server_config_t { |
110 | uint32_t server; /* Our IP, in network order */ | 110 | uint32_t server; /* Our IP, in network order */ |
111 | uint32_t start; /* Start address of leases, network order */ | 111 | uint32_t start; /* Start address of leases, network order */ |
112 | uint32_t end; /* End of leases, network order */ | 112 | uint32_t end; /* End of leases, network order */ |
113 | struct option_set *options; /* List of DHCP options loaded from the config file */ | 113 | struct option_set *options; /* List of DHCP options loaded from the config file */ |
114 | char *interface; /* The name of the interface to use */ | 114 | char *interface; /* The name of the interface to use */ |
115 | int ifindex; /* Index number of the interface to use */ | 115 | int ifindex; /* Index number of the interface to use */ |
116 | uint8_t arp[6]; /* Our arp address */ | 116 | uint8_t arp[6]; /* Our arp address */ |
117 | unsigned long lease; /* lease time in seconds (host order) */ | 117 | unsigned long lease; /* lease time in seconds (host order) */ |
118 | unsigned long max_leases; /* maximum number of leases (including reserved address) */ | 118 | unsigned long max_leases; /* maximum number of leases (including reserved address) */ |
119 | char remaining; /* should the lease file be interpreted as lease time remaining, or | 119 | char remaining; /* should the lease file be interpreted as lease time remaining, or |
120 | * as the time the lease expires */ | 120 | * as the time the lease expires */ |
121 | unsigned long auto_time; /* how long should udhcpd wait before writing a config file. | 121 | unsigned long auto_time; /* how long should udhcpd wait before writing a config file. |
122 | * if this is zero, it will only write one on SIGUSR1 */ | 122 | * if this is zero, it will only write one on SIGUSR1 */ |
123 | unsigned long decline_time; /* how long an address is reserved if a client returns a | 123 | unsigned long decline_time; /* how long an address is reserved if a client returns a |
124 | * decline message */ | 124 | * decline message */ |
125 | unsigned long conflict_time; /* how long an arp conflict offender is leased for */ | 125 | unsigned long conflict_time; /* how long an arp conflict offender is leased for */ |
126 | unsigned long offer_time; /* how long an offered address is reserved */ | 126 | unsigned long offer_time; /* how long an offered address is reserved */ |
127 | unsigned long min_lease; /* minimum lease a client can request*/ | 127 | unsigned long min_lease; /* minimum lease a client can request*/ |
128 | char *lease_file; | 128 | char *lease_file; |
129 | char *pidfile; | 129 | char *pidfile; |
130 | char *notify_file; /* What to run whenever leases are written */ | 130 | char *notify_file; /* What to run whenever leases are written */ |
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index 40e68a0a8..01534f2bb 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c | |||
@@ -271,7 +271,7 @@ static const struct config_keyword keywords[] = { | |||
271 | {"boot_file", read_str, &(server_config.boot_file), ""}, | 271 | {"boot_file", read_str, &(server_config.boot_file), ""}, |
272 | {"static_lease",read_staticlease, &(server_config.static_leases), ""}, | 272 | {"static_lease",read_staticlease, &(server_config.static_leases), ""}, |
273 | /*ADDME: static lease */ | 273 | /*ADDME: static lease */ |
274 | {"", NULL, NULL, ""} | 274 | {"", NULL, NULL, ""} |
275 | }; | 275 | }; |
276 | 276 | ||
277 | 277 | ||
diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c index 4da21a23b..bb08c3adb 100644 --- a/networking/udhcp/leases.c +++ b/networking/udhcp/leases.c | |||
@@ -148,7 +148,7 @@ uint32_t find_address(int check_expired) | |||
148 | (check_expired && lease_expired(lease))) && | 148 | (check_expired && lease_expired(lease))) && |
149 | 149 | ||
150 | /* and it isn't on the network */ | 150 | /* and it isn't on the network */ |
151 | !check_ip(ret)) { | 151 | !check_ip(ret)) { |
152 | return ret; | 152 | return ret; |
153 | break; | 153 | break; |
154 | } | 154 | } |
diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h index 0dae40172..30e167f64 100644 --- a/networking/udhcp/libbb_udhcp.h +++ b/networking/udhcp/libbb_udhcp.h | |||
@@ -29,19 +29,19 @@ | |||
29 | 29 | ||
30 | /* make safe the exported namespace */ | 30 | /* make safe the exported namespace */ |
31 | /* from common.h */ | 31 | /* from common.h */ |
32 | #define background udhcp_background | 32 | #define background udhcp_background |
33 | #define start_log_and_pid udhcp_start_log_and_pid | 33 | #define start_log_and_pid udhcp_start_log_and_pid |
34 | /* from script.h */ | 34 | /* from script.h */ |
35 | #define run_script udhcp_run_script | 35 | #define run_script udhcp_run_script |
36 | /* from packet.h */ | 36 | /* from packet.h */ |
37 | #define init_header udhcp_init_header | 37 | #define init_header udhcp_init_header |
38 | #define get_packet udhcp_get_packet | 38 | #define get_packet udhcp_get_packet |
39 | #define checksum udhcp_checksum | 39 | #define checksum udhcp_checksum |
40 | #define raw_packet udhcp_raw_packet | 40 | #define raw_packet udhcp_raw_packet |
41 | #define kernel_packet udhcp_kernel_packet | 41 | #define kernel_packet udhcp_kernel_packet |
42 | /* from pidfile.h */ | 42 | /* from pidfile.h */ |
43 | #define pidfile_acquire udhcp_pidfile_acquire | 43 | #define pidfile_acquire udhcp_pidfile_acquire |
44 | #define pidfile_write_release udhcp_pidfile_write_release | 44 | #define pidfile_write_release udhcp_pidfile_write_release |
45 | /* from options.h */ | 45 | /* from options.h */ |
46 | #define get_option udhcp_get_option | 46 | #define get_option udhcp_get_option |
47 | #define end_option udhcp_end_option | 47 | #define end_option udhcp_end_option |
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c index 144345134..eebcaaa58 100644 --- a/networking/udhcp/options.c +++ b/networking/udhcp/options.c | |||
@@ -154,11 +154,11 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data) | |||
154 | for (dh=dhcp_options; dh->code; dh++) { | 154 | for (dh=dhcp_options; dh->code; dh++) { |
155 | if (dh->code == code) { | 155 | if (dh->code == code) { |
156 | uint8_t option[6], len; | 156 | uint8_t option[6], len; |
157 | 157 | ||
158 | option[OPT_CODE] = code; | 158 | option[OPT_CODE] = code; |
159 | len = option_lengths[dh->flags & TYPE_MASK]; | 159 | len = option_lengths[dh->flags & TYPE_MASK]; |
160 | option[OPT_LEN] = len; | 160 | option[OPT_LEN] = len; |
161 | if (__BYTE_ORDER == __BIG_ENDIAN) | 161 | if (__BYTE_ORDER == __BIG_ENDIAN) |
162 | data <<= 8 * (4 - len); | 162 | data <<= 8 * (4 - len); |
163 | /* This memcpy is for broken processors which can't | 163 | /* This memcpy is for broken processors which can't |
164 | * handle a simple unaligned 32-bit assignment */ | 164 | * handle a simple unaligned 32-bit assignment */ |
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index 1c6bb0ca4..64a910031 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c | |||
@@ -71,13 +71,13 @@ int get_packet(struct dhcpMessage *packet, int fd) | |||
71 | for (i = 0; broken_vendors[i][0]; i++) { | 71 | for (i = 0; broken_vendors[i][0]; i++) { |
72 | if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) && | 72 | if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) && |
73 | !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) { | 73 | !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) { |
74 | DEBUG(LOG_INFO, "broken client (%s), forcing broadcast", | 74 | DEBUG(LOG_INFO, "broken client (%s), forcing broadcast", |
75 | broken_vendors[i]); | 75 | broken_vendors[i]); |
76 | packet->flags |= htons(BROADCAST_FLAG); | 76 | packet->flags |= htons(BROADCAST_FLAG); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | return bytes; | 82 | return bytes; |
83 | } | 83 | } |
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index c04c69f7e..b6b0e0d59 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
@@ -97,7 +97,7 @@ static void fill_options(char *dest, uint8_t *option, struct dhcp_option *type_p | |||
97 | optlen = 4; | 97 | optlen = 4; |
98 | case OPTION_IP: /* Works regardless of host byte order. */ | 98 | case OPTION_IP: /* Works regardless of host byte order. */ |
99 | dest += sprintip(dest, "", option); | 99 | dest += sprintip(dest, "", option); |
100 | break; | 100 | break; |
101 | case OPTION_BOOLEAN: | 101 | case OPTION_BOOLEAN: |
102 | dest += sprintf(dest, *option ? "yes" : "no"); | 102 | dest += sprintf(dest, *option ? "yes" : "no"); |
103 | break; | 103 | break; |
diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c index c6a820909..1b89862b2 100644 --- a/networking/udhcp/serverpacket.c +++ b/networking/udhcp/serverpacket.c | |||
@@ -138,11 +138,11 @@ int sendOffer(struct dhcpMessage *oldpacket) | |||
138 | /* and the ip is in the lease range */ | 138 | /* and the ip is in the lease range */ |
139 | ntohl(req_align) >= ntohl(server_config.start) && | 139 | ntohl(req_align) >= ntohl(server_config.start) && |
140 | ntohl(req_align) <= ntohl(server_config.end) && | 140 | ntohl(req_align) <= ntohl(server_config.end) && |
141 | 141 | ||
142 | !static_lease_ip && /* Check that its not a static lease */ | 142 | !static_lease_ip && /* Check that its not a static lease */ |
143 | /* and is not already taken/offered */ | 143 | /* and is not already taken/offered */ |
144 | ((!(lease = find_lease_by_yiaddr(req_align)) || | 144 | ((!(lease = find_lease_by_yiaddr(req_align)) || |
145 | 145 | ||
146 | /* or its taken, but expired */ /* ADDME: or maybe in here */ | 146 | /* or its taken, but expired */ /* ADDME: or maybe in here */ |
147 | lease_expired(lease)))) { | 147 | lease_expired(lease)))) { |
148 | packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */ | 148 | packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */ |
diff --git a/networking/vconfig.c b/networking/vconfig.c index bbd29873c..36458f784 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c | |||
@@ -54,20 +54,20 @@ struct vlan_ioctl_args { | |||
54 | int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */ | 54 | int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */ |
55 | char device1[24]; | 55 | char device1[24]; |
56 | 56 | ||
57 | union { | 57 | union { |
58 | char device2[24]; | 58 | char device2[24]; |
59 | int VID; | 59 | int VID; |
60 | unsigned int skb_priority; | 60 | unsigned int skb_priority; |
61 | unsigned int name_type; | 61 | unsigned int name_type; |
62 | unsigned int bind_type; | 62 | unsigned int bind_type; |
63 | unsigned int flag; /* Matches vlan_dev_info flags */ | 63 | unsigned int flag; /* Matches vlan_dev_info flags */ |
64 | } u; | 64 | } u; |
65 | 65 | ||
66 | short vlan_qos; | 66 | short vlan_qos; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | #define VLAN_GROUP_ARRAY_LEN 4096 | 69 | #define VLAN_GROUP_ARRAY_LEN 4096 |
70 | #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ | 70 | #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ |
71 | 71 | ||
72 | /* On entry, table points to the length of the current string plus | 72 | /* On entry, table points to the length of the current string plus |
73 | * nul terminator plus data length for the subsequent entry. The | 73 | * nul terminator plus data length for the subsequent entry. The |
diff --git a/networking/wget.c b/networking/wget.c index 29f5d45c3..9c7ed9f1d 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -118,22 +118,22 @@ static char *safe_fgets(char *s, int size, FILE *stream) | |||
118 | */ | 118 | */ |
119 | static char *base64enc(unsigned char *p, char *buf, int len) { | 119 | static char *base64enc(unsigned char *p, char *buf, int len) { |
120 | 120 | ||
121 | char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | 121 | char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
122 | "0123456789+/"; | 122 | "0123456789+/"; |
123 | char *s = buf; | 123 | char *s = buf; |
124 | 124 | ||
125 | while(*p) { | 125 | while(*p) { |
126 | if (s >= buf+len-4) | 126 | if (s >= buf+len-4) |
127 | bb_error_msg_and_die("buffer overflow"); | 127 | bb_error_msg_and_die("buffer overflow"); |
128 | *(s++) = al[(*p >> 2) & 0x3F]; | 128 | *(s++) = al[(*p >> 2) & 0x3F]; |
129 | *(s++) = al[((*p << 4) & 0x30) | ((*(p+1) >> 4) & 0x0F)]; | 129 | *(s++) = al[((*p << 4) & 0x30) | ((*(p+1) >> 4) & 0x0F)]; |
130 | *s = *(s+1) = '='; | 130 | *s = *(s+1) = '='; |
131 | *(s+2) = 0; | 131 | *(s+2) = 0; |
132 | if (! *(++p)) break; | 132 | if (! *(++p)) break; |
133 | *(s++) = al[((*p << 2) & 0x3C) | ((*(p+1) >> 6) & 0x03)]; | 133 | *(s++) = al[((*p << 2) & 0x3C) | ((*(p+1) >> 6) & 0x03)]; |
134 | if (! *(++p)) break; | 134 | if (! *(++p)) break; |
135 | *(s++) = al[*(p++) & 0x3F]; | 135 | *(s++) = al[*(p++) & 0x3F]; |
136 | } | 136 | } |
137 | 137 | ||
138 | return buf; | 138 | return buf; |
139 | } | 139 | } |
@@ -190,8 +190,8 @@ int wget_main(int argc, char **argv) | |||
190 | */ | 190 | */ |
191 | bb_opt_complementally = "-1:\203::"; | 191 | bb_opt_complementally = "-1:\203::"; |
192 | bb_applet_long_options = wget_long_options; | 192 | bb_applet_long_options = wget_long_options; |
193 | opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:", | 193 | opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:", |
194 | &fname_out, &headers_llist, | 194 | &fname_out, &headers_llist, |
195 | &dir_prefix, &proxy_flag); | 195 | &dir_prefix, &proxy_flag); |
196 | if (opt & WGET_OPT_CONTINUE) { | 196 | if (opt & WGET_OPT_CONTINUE) { |
197 | ++do_continue; | 197 | ++do_continue; |
@@ -217,7 +217,7 @@ int wget_main(int argc, char **argv) | |||
217 | headers_llist = headers_llist->link; | 217 | headers_llist = headers_llist->link; |
218 | } | 218 | } |
219 | } | 219 | } |
220 | 220 | ||
221 | parse_url(argv[optind], &target); | 221 | parse_url(argv[optind], &target); |
222 | server.host = target.host; | 222 | server.host = target.host; |
223 | server.port = target.port; | 223 | server.port = target.port; |
@@ -347,8 +347,8 @@ int wget_main(int argc, char **argv) | |||
347 | fprintf(sfp,"Connection: close\r\n\r\n"); | 347 | fprintf(sfp,"Connection: close\r\n\r\n"); |
348 | 348 | ||
349 | /* | 349 | /* |
350 | * Retrieve HTTP response line and check for "200" status code. | 350 | * Retrieve HTTP response line and check for "200" status code. |
351 | */ | 351 | */ |
352 | read_response: | 352 | read_response: |
353 | if (fgets(buf, sizeof(buf), sfp) == NULL) | 353 | if (fgets(buf, sizeof(buf), sfp) == NULL) |
354 | close_delete_and_die("no response from server"); | 354 | close_delete_and_die("no response from server"); |
diff --git a/networking/zcip.c b/networking/zcip.c index 294ffd066..b64e37c58 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
@@ -174,7 +174,7 @@ run(char *script, char *arg, char *intf, struct in_addr *ip) | |||
174 | execl(script, script, arg, NULL); | 174 | execl(script, script, arg, NULL); |
175 | perror("execl"); | 175 | perror("execl"); |
176 | _exit(EXIT_FAILURE); | 176 | _exit(EXIT_FAILURE); |
177 | } | 177 | } |
178 | 178 | ||
179 | if (waitpid(pid, &status, 0) <= 0) { | 179 | if (waitpid(pid, &status, 0) <= 0) { |
180 | why = "waitpid"; | 180 | why = "waitpid"; |
@@ -365,7 +365,7 @@ fail: | |||
365 | fds[0].events = POLLIN; | 365 | fds[0].events = POLLIN; |
366 | fds[0].revents = 0; | 366 | fds[0].revents = 0; |
367 | 367 | ||
368 | // poll, being ready to adjust current timeout | 368 | // poll, being ready to adjust current timeout |
369 | if (timeout > 0) { | 369 | if (timeout > 0) { |
370 | gettimeofday(&tv1, NULL); | 370 | gettimeofday(&tv1, NULL); |
371 | tv1.tv_usec += (timeout % 1000) * 1000; | 371 | tv1.tv_usec += (timeout % 1000) * 1000; |
@@ -477,7 +477,7 @@ fail: | |||
477 | && p.arp.ar_op != htons(ARPOP_REPLY)) | 477 | && p.arp.ar_op != htons(ARPOP_REPLY)) |
478 | continue; | 478 | continue; |
479 | 479 | ||
480 | // some cases are always conflicts | 480 | // some cases are always conflicts |
481 | if ((p.source_ip.s_addr == ip.s_addr) | 481 | if ((p.source_ip.s_addr == ip.s_addr) |
482 | && (memcmp(&addr, &p.source_addr, | 482 | && (memcmp(&addr, &p.source_addr, |
483 | ETH_ALEN) != 0)) { | 483 | ETH_ALEN) != 0)) { |
@@ -533,7 +533,7 @@ collision: | |||
533 | bad: | 533 | bad: |
534 | if (foreground) | 534 | if (foreground) |
535 | perror(why); | 535 | perror(why); |
536 | else | 536 | else |
537 | syslog(LOG_ERR, "%s %s, %s error: %s", | 537 | syslog(LOG_ERR, "%s %s, %s error: %s", |
538 | prog, intf, why, strerror(errno)); | 538 | prog, intf, why, strerror(errno)); |
539 | return EXIT_FAILURE; | 539 | return EXIT_FAILURE; |