diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-21 18:38:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-21 18:38:51 +0200 |
commit | 9de2e5a22213842da5b116723392de88de9ed419 (patch) | |
tree | dff999a566382174e084d377dc3b4c03de1d4c62 /networking | |
parent | 47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 (diff) | |
download | busybox-w32-9de2e5a22213842da5b116723392de88de9ed419.tar.gz busybox-w32-9de2e5a22213842da5b116723392de88de9ed419.tar.bz2 busybox-w32-9de2e5a22213842da5b116723392de88de9ed419.zip |
*: hopefully all setup_common_bufsiz() are in place
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 1 | ||||
-rw-r--r-- | networking/isrv_identd.c | 7 | ||||
-rw-r--r-- | networking/libiproute/ipaddress.c | 5 | ||||
-rw-r--r-- | networking/libiproute/ipneigh.c | 3 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 3 | ||||
-rw-r--r-- | networking/nc.c | 3 |
6 files changed, 17 insertions, 5 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index ef90770ac..abe83a458 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -370,6 +370,7 @@ enum { | |||
370 | # define content_gzip 0 | 370 | # define content_gzip 0 |
371 | #endif | 371 | #endif |
372 | #define INIT_G() do { \ | 372 | #define INIT_G() do { \ |
373 | setup_common_bufsiz(); \ | ||
373 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ | 374 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
374 | IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ | 375 | IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ |
375 | IF_FEATURE_HTTPD_RANGES(range_start = -1;) \ | 376 | IF_FEATURE_HTTPD_RANGES(range_start = -1;) \ |
diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c index f63ed8ee4..8a15926e5 100644 --- a/networking/isrv_identd.c +++ b/networking/isrv_identd.c | |||
@@ -29,8 +29,7 @@ typedef struct identd_buf_t { | |||
29 | char buf[64 - sizeof(int)]; | 29 | char buf[64 - sizeof(int)]; |
30 | } identd_buf_t; | 30 | } identd_buf_t; |
31 | 31 | ||
32 | #define bogouser bb_common_bufsiz1 | 32 | #define bogouser bb_common_bufsiz1 |
33 | #define sizeof_bogouser COMMON_BUFSIZE | ||
34 | 33 | ||
35 | static int new_peer(isrv_state_t *state, int fd) | 34 | static int new_peer(isrv_state_t *state, int fd) |
36 | { | 35 | { |
@@ -117,10 +116,12 @@ int fakeidentd_main(int argc UNUSED_PARAM, char **argv) | |||
117 | unsigned opt; | 116 | unsigned opt; |
118 | int fd; | 117 | int fd; |
119 | 118 | ||
119 | setup_common_bufsiz(); | ||
120 | |||
120 | opt = getopt32(argv, "fiwb:", &bind_address); | 121 | opt = getopt32(argv, "fiwb:", &bind_address); |
121 | strcpy(bogouser, "nobody"); | 122 | strcpy(bogouser, "nobody"); |
122 | if (argv[optind]) | 123 | if (argv[optind]) |
123 | strncpy(bogouser, argv[optind], sizeof_bogouser - 1); | 124 | strncpy(bogouser, argv[optind], COMMON_BUFSIZE - 1); |
124 | 125 | ||
125 | /* Daemonize if no -f and no -i and no -w */ | 126 | /* Daemonize if no -f and no -i and no -w */ |
126 | if (!(opt & OPT_fiw)) | 127 | if (!(opt & OPT_fiw)) |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 2c0f514c7..d9e099607 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -41,7 +41,7 @@ struct filter_t { | |||
41 | typedef struct filter_t filter_t; | 41 | typedef struct filter_t filter_t; |
42 | 42 | ||
43 | #define G_filter (*(filter_t*)bb_common_bufsiz1) | 43 | #define G_filter (*(filter_t*)bb_common_bufsiz1) |
44 | 44 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | |
45 | 45 | ||
46 | static void print_link_flags(unsigned flags, unsigned mdown) | 46 | static void print_link_flags(unsigned flags, unsigned mdown) |
47 | { | 47 | { |
@@ -745,6 +745,9 @@ int FAST_FUNC do_ipaddr(char **argv) | |||
745 | /* 0 1 2 3 4 5 6 7 8 */ | 745 | /* 0 1 2 3 4 5 6 7 8 */ |
746 | "add\0""change\0""chg\0""replace\0""delete\0""list\0""show\0""lst\0""flush\0"; | 746 | "add\0""change\0""chg\0""replace\0""delete\0""list\0""show\0""lst\0""flush\0"; |
747 | int cmd = 2; | 747 | int cmd = 2; |
748 | |||
749 | INIT_G(); | ||
750 | |||
748 | if (*argv) { | 751 | if (*argv) { |
749 | cmd = index_in_substrings(commands, *argv); | 752 | cmd = index_in_substrings(commands, *argv); |
750 | if (cmd < 0) | 753 | if (cmd < 0) |
diff --git a/networking/libiproute/ipneigh.c b/networking/libiproute/ipneigh.c index 151d3d109..d2028b7b6 100644 --- a/networking/libiproute/ipneigh.c +++ b/networking/libiproute/ipneigh.c | |||
@@ -42,6 +42,7 @@ struct filter_t { | |||
42 | typedef struct filter_t filter_t; | 42 | typedef struct filter_t filter_t; |
43 | 43 | ||
44 | #define G_filter (*(filter_t*)bb_common_bufsiz1) | 44 | #define G_filter (*(filter_t*)bb_common_bufsiz1) |
45 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
45 | 46 | ||
46 | static int flush_update(void) | 47 | static int flush_update(void) |
47 | { | 48 | { |
@@ -339,6 +340,8 @@ int FAST_FUNC do_ipneigh(char **argv) | |||
339 | /*0-1*/ "show\0" "flush\0"; | 340 | /*0-1*/ "show\0" "flush\0"; |
340 | int command_num; | 341 | int command_num; |
341 | 342 | ||
343 | INIT_G(); | ||
344 | |||
342 | if (!*argv) | 345 | if (!*argv) |
343 | return ipneigh_list_or_flush(argv, 0); | 346 | return ipneigh_list_or_flush(argv, 0); |
344 | 347 | ||
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index 34d4f4758..e674e9a0d 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -45,6 +45,7 @@ struct filter_t { | |||
45 | typedef struct filter_t filter_t; | 45 | typedef struct filter_t filter_t; |
46 | 46 | ||
47 | #define G_filter (*(filter_t*)bb_common_bufsiz1) | 47 | #define G_filter (*(filter_t*)bb_common_bufsiz1) |
48 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
48 | 49 | ||
49 | static int flush_update(void) | 50 | static int flush_update(void) |
50 | { | 51 | { |
@@ -903,6 +904,8 @@ int FAST_FUNC do_iproute(char **argv) | |||
903 | unsigned flags = 0; | 904 | unsigned flags = 0; |
904 | int cmd = RTM_NEWROUTE; | 905 | int cmd = RTM_NEWROUTE; |
905 | 906 | ||
907 | INIT_G(); | ||
908 | |||
906 | if (!*argv) | 909 | if (!*argv) |
907 | return iproute_list_or_flush(argv, 0); | 910 | return iproute_list_or_flush(argv, 0); |
908 | 911 | ||
diff --git a/networking/nc.c b/networking/nc.c index 50edee450..13a9b48a8 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -239,6 +239,8 @@ int nc_main(int argc, char **argv) | |||
239 | FD_SET(cfd, &readfds); | 239 | FD_SET(cfd, &readfds); |
240 | FD_SET(STDIN_FILENO, &readfds); | 240 | FD_SET(STDIN_FILENO, &readfds); |
241 | 241 | ||
242 | #define iobuf bb_common_bufsiz1 | ||
243 | setup_common_bufsiz(); | ||
242 | for (;;) { | 244 | for (;;) { |
243 | int fd; | 245 | int fd; |
244 | int ofd; | 246 | int ofd; |
@@ -249,7 +251,6 @@ int nc_main(int argc, char **argv) | |||
249 | if (select(cfd + 1, &testfds, NULL, NULL, NULL) < 0) | 251 | if (select(cfd + 1, &testfds, NULL, NULL, NULL) < 0) |
250 | bb_perror_msg_and_die("select"); | 252 | bb_perror_msg_and_die("select"); |
251 | 253 | ||
252 | #define iobuf bb_common_bufsiz1 | ||
253 | fd = STDIN_FILENO; | 254 | fd = STDIN_FILENO; |
254 | while (1) { | 255 | while (1) { |
255 | if (FD_ISSET(fd, &testfds)) { | 256 | if (FD_ISSET(fd, &testfds)) { |