aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 18:38:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 18:38:51 +0200
commit9de2e5a22213842da5b116723392de88de9ed419 (patch)
treedff999a566382174e084d377dc3b4c03de1d4c62 /networking
parent47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 (diff)
downloadbusybox-9de2e5a22213842da5b116723392de88de9ed419.tar.gz
*: 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.c1
-rw-r--r--networking/isrv_identd.c7
-rw-r--r--networking/libiproute/ipaddress.c5
-rw-r--r--networking/libiproute/ipneigh.c3
-rw-r--r--networking/libiproute/iproute.c3
-rw-r--r--networking/nc.c3
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 {
# define content_gzip 0
#endif
#define INIT_G() do { \
+ setup_common_bufsiz(); \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \
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 {
char buf[64 - sizeof(int)];
} identd_buf_t;
-#define bogouser bb_common_bufsiz1
-#define sizeof_bogouser COMMON_BUFSIZE
+#define bogouser bb_common_bufsiz1
static int new_peer(isrv_state_t *state, int fd)
{
@@ -117,10 +116,12 @@ int fakeidentd_main(int argc UNUSED_PARAM, char **argv)
unsigned opt;
int fd;
+ setup_common_bufsiz();
+
opt = getopt32(argv, "fiwb:", &bind_address);
strcpy(bogouser, "nobody");
if (argv[optind])
- strncpy(bogouser, argv[optind], sizeof_bogouser - 1);
+ strncpy(bogouser, argv[optind], COMMON_BUFSIZE - 1);
/* Daemonize if no -f and no -i and no -w */
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 {
typedef struct filter_t filter_t;
#define G_filter (*(filter_t*)bb_common_bufsiz1)
-
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void print_link_flags(unsigned flags, unsigned mdown)
{
@@ -745,6 +745,9 @@ int FAST_FUNC do_ipaddr(char **argv)
/* 0 1 2 3 4 5 6 7 8 */
"add\0""change\0""chg\0""replace\0""delete\0""list\0""show\0""lst\0""flush\0";
int cmd = 2;
+
+ INIT_G();
+
if (*argv) {
cmd = index_in_substrings(commands, *argv);
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 {
typedef struct filter_t filter_t;
#define G_filter (*(filter_t*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static int flush_update(void)
{
@@ -339,6 +340,8 @@ int FAST_FUNC do_ipneigh(char **argv)
/*0-1*/ "show\0" "flush\0";
int command_num;
+ INIT_G();
+
if (!*argv)
return ipneigh_list_or_flush(argv, 0);
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 {
typedef struct filter_t filter_t;
#define G_filter (*(filter_t*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static int flush_update(void)
{
@@ -903,6 +904,8 @@ int FAST_FUNC do_iproute(char **argv)
unsigned flags = 0;
int cmd = RTM_NEWROUTE;
+ INIT_G();
+
if (!*argv)
return iproute_list_or_flush(argv, 0);
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)
FD_SET(cfd, &readfds);
FD_SET(STDIN_FILENO, &readfds);
+#define iobuf bb_common_bufsiz1
+ setup_common_bufsiz();
for (;;) {
int fd;
int ofd;
@@ -249,7 +251,6 @@ int nc_main(int argc, char **argv)
if (select(cfd + 1, &testfds, NULL, NULL, NULL) < 0)
bb_perror_msg_and_die("select");
-#define iobuf bb_common_bufsiz1
fd = STDIN_FILENO;
while (1) {
if (FD_ISSET(fd, &testfds)) {