aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:04:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:04:04 +0000
commit85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50 (patch)
tree0b60f25ea0ebfbac5d9b3fa22f123aadaecd6663 /networking
parent081eb71ebd7954a67287816a9a6fff80e8c5319a (diff)
downloadbusybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.gz
busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.bz2
busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.zip
*: fix fallout from -Wunused-parameter
function old new delta bbunpack 358 366 +8 passwd_main 1070 1072 +2 handle_incoming_and_exit 2651 2653 +2 getpty 88 86 -2 script_main 975 972 -3 inetd_main 2036 2033 -3 dname_enc 377 373 -4 make_new_session 474 462 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24) Total: -12 bytes text data bss dec hex filename 797429 658 7428 805515 c4a8b busybox_old 797417 658 7428 805503 c4a7f busybox_unstripped
Diffstat (limited to 'networking')
-rw-r--r--networking/Kbuild2
-rw-r--r--networking/ether-wake.c2
-rw-r--r--networking/httpd.c13
-rw-r--r--networking/ifupdown.c22
-rw-r--r--networking/inetd.c22
-rw-r--r--networking/nc.c2
-rw-r--r--networking/sendmail.c4
-rw-r--r--networking/telnetd.c4
-rw-r--r--networking/traceroute.c4
-rw-r--r--networking/udhcp/clientsocket.c2
-rw-r--r--networking/wget.c2
11 files changed, 57 insertions, 22 deletions
diff --git a/networking/Kbuild b/networking/Kbuild
index e06a12462..44258e9b0 100644
--- a/networking/Kbuild
+++ b/networking/Kbuild
@@ -17,7 +17,7 @@ lib-$(CONFIG_FTPPUT) += ftpgetput.o
17lib-$(CONFIG_HOSTNAME) += hostname.o 17lib-$(CONFIG_HOSTNAME) += hostname.o
18lib-$(CONFIG_HTTPD) += httpd.o 18lib-$(CONFIG_HTTPD) += httpd.o
19lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o 19lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o
20lib-$(CONFIG_IFENSLAVE) += ifenslave.o 20lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o
21lib-$(CONFIG_IFUPDOWN) += ifupdown.o 21lib-$(CONFIG_IFUPDOWN) += ifupdown.o
22lib-$(CONFIG_INETD) += inetd.o 22lib-$(CONFIG_INETD) += inetd.o
23lib-$(CONFIG_IP) += ip.o 23lib-$(CONFIG_IP) += ip.o
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index b752152e1..fcd7dd2bc 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -179,7 +179,7 @@ static int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd)
179} 179}
180 180
181int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 181int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
182int ether_wake_main(int argc, char **argv) 182int ether_wake_main(int argc ATTRIBUTE_UNUSED, char **argv)
183{ 183{
184 const char *ifname = "eth0"; 184 const char *ifname = "eth0";
185 char *pass; 185 char *pass;
diff --git a/networking/httpd.c b/networking/httpd.c
index 54f288c7a..522e7eec0 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1972,7 +1972,11 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
1972 /* Try and do our best to parse more lines */ 1972 /* Try and do our best to parse more lines */
1973 if ((STRNCASECMP(iobuf, "Content-length:") == 0)) { 1973 if ((STRNCASECMP(iobuf, "Content-length:") == 0)) {
1974 /* extra read only for POST */ 1974 /* extra read only for POST */
1975 if (prequest != request_GET && prequest != request_HEAD) { 1975 if (prequest != request_GET
1976#if ENABLE_FEATURE_HTTPD_CGI
1977 && prequest != request_HEAD
1978#endif
1979 ) {
1976 tptr = iobuf + sizeof("Content-length:") - 1; 1980 tptr = iobuf + sizeof("Content-length:") - 1;
1977 if (!tptr[0]) 1981 if (!tptr[0])
1978 send_headers_and_exit(HTTP_BAD_REQUEST); 1982 send_headers_and_exit(HTTP_BAD_REQUEST);
@@ -2129,7 +2133,12 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
2129 */ 2133 */
2130 2134
2131 send_file_and_exit(tptr, 2135 send_file_and_exit(tptr,
2132 (prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)); 2136#if ENABLE_FEATURE_HTTPD_CGI
2137 (prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)
2138#else
2139 SEND_HEADERS_AND_BODY
2140#endif
2141 );
2133} 2142}
2134 2143
2135/* 2144/*
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 6aa929a30..586c3db63 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -483,9 +483,9 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
483}; 483};
484#endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */ 484#endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */
485 485
486#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
486static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) 487static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
487{ 488{
488#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
489 int i; 489 int i;
490#if ENABLE_FEATURE_IFUPDOWN_IP 490#if ENABLE_FEATURE_IFUPDOWN_IP
491 /* ip doesn't up iface when it configures it (unlike ifconfig) */ 491 /* ip doesn't up iface when it configures it (unlike ifconfig) */
@@ -498,7 +498,10 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
498 } 498 }
499 bb_error_msg("no dhcp clients found"); 499 bb_error_msg("no dhcp clients found");
500 return 0; 500 return 0;
501}
501#elif ENABLE_APP_UDHCPC 502#elif ENABLE_APP_UDHCPC
503static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
504{
502#if ENABLE_FEATURE_IFUPDOWN_IP 505#if ENABLE_FEATURE_IFUPDOWN_IP
503 /* ip doesn't up iface when it configures it (unlike ifconfig) */ 506 /* ip doesn't up iface when it configures it (unlike ifconfig) */
504 if (!execute("ip link set %iface% up", ifd, exec)) 507 if (!execute("ip link set %iface% up", ifd, exec))
@@ -507,14 +510,18 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
507 return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid " 510 return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
508 "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]", 511 "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
509 ifd, exec); 512 ifd, exec);
513}
510#else 514#else
515static int dhcp_up(struct interface_defn_t *ifd ATTRIBUTE_UNUSED,
516 execfn *exec ATTRIBUTE_UNUSED)
517{
511 return 0; /* no dhcp support */ 518 return 0; /* no dhcp support */
512#endif
513} 519}
520#endif
514 521
522#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
515static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) 523static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
516{ 524{
517#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
518 int i; 525 int i;
519 for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { 526 for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
520 if (exists_execable(ext_dhcp_clients[i].name)) 527 if (exists_execable(ext_dhcp_clients[i].name))
@@ -522,13 +529,20 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
522 } 529 }
523 bb_error_msg("no dhcp clients found, using static interface shutdown"); 530 bb_error_msg("no dhcp clients found, using static interface shutdown");
524 return static_down(ifd, exec); 531 return static_down(ifd, exec);
532}
525#elif ENABLE_APP_UDHCPC 533#elif ENABLE_APP_UDHCPC
534static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
535{
526 return execute("kill " 536 return execute("kill "
527 "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); 537 "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
538}
528#else 539#else
540static int dhcp_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED,
541 execfn *exec ATTRIBUTE_UNUSED)
542{
529 return 0; /* no dhcp support */ 543 return 0; /* no dhcp support */
530#endif
531} 544}
545#endif
532 546
533static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED) 547static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED)
534{ 548{
diff --git a/networking/inetd.c b/networking/inetd.c
index 0ddfa6b45..b931aa1e0 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1331,10 +1331,10 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
1331 continue; /* -> check next fd in fd set */ 1331 continue; /* -> check next fd in fd set */
1332 } 1332 }
1333 1333
1334 /* we are either child or didn't fork at all */ 1334 /* we are either child or didn't vfork at all */
1335#ifdef INETD_BUILTINS_ENABLED 1335#ifdef INETD_BUILTINS_ENABLED
1336 if (sep->se_builtin) { 1336 if (sep->se_builtin) {
1337 if (pid) { /* "pid" is -1: we did fork */ 1337 if (pid) { /* "pid" is -1: we did vfork */
1338 close(sep->se_fd); /* listening socket */ 1338 close(sep->se_fd); /* listening socket */
1339 logmode = 0; /* make xwrite etc silent */ 1339 logmode = 0; /* make xwrite etc silent */
1340 } 1340 }
@@ -1343,8 +1343,8 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
1343 sep->se_builtin->bi_stream_fn(ctrl, sep); 1343 sep->se_builtin->bi_stream_fn(ctrl, sep);
1344 else 1344 else
1345 sep->se_builtin->bi_dgram_fn(ctrl, sep); 1345 sep->se_builtin->bi_dgram_fn(ctrl, sep);
1346 if (pid) /* we did fork */ 1346 if (pid) /* we did vfork */
1347 _exit(0); 1347 _exit(1);
1348 maybe_close(accepted_fd); 1348 maybe_close(accepted_fd);
1349 continue; /* -> check next fd in fd set */ 1349 continue; /* -> check next fd in fd set */
1350 } 1350 }
@@ -1430,11 +1430,15 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
1430 xwrite(s, line, sz); 1430 xwrite(s, line, sz);
1431 } 1431 }
1432#else 1432#else
1433 /* We are after vfork here! */
1433 static const char *const args[] = { "cat", NULL }; 1434 static const char *const args[] = { "cat", NULL };
1434 /* no error messages */ 1435 /* move network socket to stdin */
1436 xmove_fd(s, STDIN_FILENO);
1437 xdup2(STDIN_FILENO, STDOUT_FILENO);
1438 /* no error messages please... */
1435 xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); 1439 xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO);
1436 BB_EXECVP("cat", (char**)args); 1440 BB_EXECVP("cat", (char**)args);
1437 _exit(1); 1441 /* on failure we return to main, which does exit(1) */
1438#endif 1442#endif
1439} 1443}
1440static void echo_dg(int s, servtab_t *sep) 1444static void echo_dg(int s, servtab_t *sep)
@@ -1463,11 +1467,15 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
1463 while (safe_read(s, line, LINE_SIZE) > 0) 1467 while (safe_read(s, line, LINE_SIZE) > 0)
1464 continue; 1468 continue;
1465#else 1469#else
1470 /* We are after vfork here! */
1466 static const char *const args[] = { "dd", "of=/dev/null", NULL }; 1471 static const char *const args[] = { "dd", "of=/dev/null", NULL };
1472 /* move network socket to stdin */
1473 xmove_fd(s, STDIN_FILENO);
1474 xdup2(STDIN_FILENO, STDOUT_FILENO);
1467 /* no error messages */ 1475 /* no error messages */
1468 xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); 1476 xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO);
1469 BB_EXECVP("dd", (char**)args); 1477 BB_EXECVP("dd", (char**)args);
1470 _exit(1); 1478 /* on failure we return to main, which does exit(1) */
1471#endif 1479#endif
1472} 1480}
1473/* ARGSUSED */ 1481/* ARGSUSED */
diff --git a/networking/nc.c b/networking/nc.c
index 7c2aafaf6..7d4a6e047 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -17,7 +17,7 @@
17 * when compared to "standard" nc 17 * when compared to "standard" nc
18 */ 18 */
19 19
20static void timeout(int signum) 20static void timeout(int signum ATTRIBUTE_UNUSED)
21{ 21{
22 bb_error_msg_and_die("timed out"); 22 bb_error_msg_and_die("timed out");
23} 23}
diff --git a/networking/sendmail.c b/networking/sendmail.c
index 241028b92..2eb01dc94 100644
--- a/networking/sendmail.c
+++ b/networking/sendmail.c
@@ -551,11 +551,11 @@ int sendgetmail_main(int argc ATTRIBUTE_UNUSED, char **argv)
551 int rc; 551 int rc;
552 552
553 // retrieve message in ./tmp/ 553 // retrieve message in ./tmp/
554 pop3_check(retr, (const char *)nmsg); 554 pop3_check(retr, (const char *)(ptrdiff_t)nmsg);
555 pop3_message(filename); 555 pop3_message(filename);
556 // delete message from server 556 // delete message from server
557 if (opts & OPTF_z) 557 if (opts & OPTF_z)
558 pop3_check("DELE %u", (const char*)nmsg); 558 pop3_check("DELE %u", (const char*)(ptrdiff_t)nmsg);
559 559
560 // run postprocessing program 560 // run postprocessing program
561 if (*fargs) { 561 if (*fargs) {
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 20c57925f..2ed3b74bc 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -161,14 +161,14 @@ make_new_session(
161 const char *login_argv[2]; 161 const char *login_argv[2];
162 struct termios termbuf; 162 struct termios termbuf;
163 int fd, pid; 163 int fd, pid;
164 char tty_name[32]; 164 char tty_name[GETPTY_BUFSIZE];
165 struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2); 165 struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2);
166 166
167 /*ts->buf1 = (char *)(ts + 1);*/ 167 /*ts->buf1 = (char *)(ts + 1);*/
168 /*ts->buf2 = ts->buf1 + BUFSIZE;*/ 168 /*ts->buf2 = ts->buf1 + BUFSIZE;*/
169 169
170 /* Got a new connection, set up a tty. */ 170 /* Got a new connection, set up a tty. */
171 fd = getpty(tty_name, 32); 171 fd = getpty(tty_name);
172 if (fd < 0) { 172 if (fd < 0) {
173 bb_error_msg("can't create pty"); 173 bb_error_msg("can't create pty");
174 return NULL; 174 return NULL;
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 582840af6..c0b4a3fd2 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -729,6 +729,10 @@ pr_type(unsigned char t)
729} 729}
730#endif 730#endif
731 731
732#if !ENABLE_FEATURE_TRACEROUTE_VERBOSE
733#define packet_ok(buf, cc, from, seq) \
734 packet_ok(buf, cc, seq)
735#endif
732static int 736static int
733packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) 737packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq)
734{ 738{
diff --git a/networking/udhcp/clientsocket.c b/networking/udhcp/clientsocket.c
index b5534f83e..0be661d4f 100644
--- a/networking/udhcp/clientsocket.c
+++ b/networking/udhcp/clientsocket.c
@@ -76,7 +76,7 @@ int raw_socket(int ifindex)
76 BPF_STMT(BPF_LD|BPF_W|BPF_IND, 0), 76 BPF_STMT(BPF_LD|BPF_W|BPF_IND, 0),
77 BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, SERVER_AND_CLIENT_PORTS, 0, 1), /* L3, L4 */ 77 BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, SERVER_AND_CLIENT_PORTS, 0, 1), /* L3, L4 */
78 /* returns */ 78 /* returns */
79 BPF_STMT(BPF_RET|BPF_K, ~0UL), /* L3: pass */ 79 BPF_STMT(BPF_RET|BPF_K, (~(uint32_t)0) ), /* L3: pass */
80 BPF_STMT(BPF_RET|BPF_K, 0), /* L4: reject */ 80 BPF_STMT(BPF_RET|BPF_K, 0), /* L4: reject */
81 }; 81 };
82 static const struct sock_fprog filter_prog = { 82 static const struct sock_fprog filter_prog = {
diff --git a/networking/wget.c b/networking/wget.c
index dc1dc2ad9..f8adcd700 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -189,7 +189,7 @@ static void progressmeter(int flag)
189 */ 189 */
190#else /* FEATURE_WGET_STATUSBAR */ 190#else /* FEATURE_WGET_STATUSBAR */
191 191
192static ALWAYS_INLINE void progressmeter(int flag) { } 192static ALWAYS_INLINE void progressmeter(int flag ATTRIBUTE_UNUSED) { }
193 193
194#endif 194#endif
195 195