aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/arp.c1
-rw-r--r--networking/arping.c1
-rw-r--r--networking/ftpd.c1
-rw-r--r--networking/ftpgetput.c1
-rw-r--r--networking/ifupdown.c2
-rw-r--r--networking/inetd.c1
-rw-r--r--networking/ping.c3
-rw-r--r--networking/slattach.c2
-rw-r--r--networking/tc.c1
-rw-r--r--networking/tcpudp.c1
-rw-r--r--networking/telnet.c1
-rw-r--r--networking/telnetd.c1
-rw-r--r--networking/tftp.c1
-rw-r--r--networking/udhcp/dhcprelay.c3
-rw-r--r--networking/zcip.c2
15 files changed, 18 insertions, 4 deletions
diff --git a/networking/arp.c b/networking/arp.c
index 5f7818663..9381eb53a 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -76,6 +76,7 @@ struct globals {
#define device (G.device )
#define hw_set (G.hw_set )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
device = ""; \
} while (0)
diff --git a/networking/arping.c b/networking/arping.c
index 52f5ba51f..6b0de4de2 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -77,6 +77,7 @@ struct globals {
#define brd_recv (G.brd_recv )
#define req_recv (G.req_recv )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
count = -1; \
} while (0)
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 8553a28f5..360d1e6be 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -126,6 +126,7 @@ struct globals {
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
/* Moved to main */ \
/*strcpy(G.msg_ok + 4, MSG_OK );*/ \
/*strcpy(G.msg_err + 4, MSG_ERR);*/ \
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 61bc45c4e..91fb4569a 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -71,6 +71,7 @@ enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
#define do_continue (G.do_continue )
#define buf (G.buf )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 399ff6b5d..25b04c9d7 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -131,7 +131,7 @@ struct globals {
char *shell;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static const char keywords_up_down[] ALIGN1 =
diff --git a/networking/inetd.c b/networking/inetd.c
index aa35ffa2b..8d44b5198 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -350,6 +350,7 @@ enum { LINE_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line) };
#define allsock (G.allsock )
#define line (G.line )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
rlim_ofile_cur = OPEN_MAX; \
global_queuelen = 128; \
diff --git a/networking/ping.c b/networking/ping.c
index 761660979..cfe682646 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -188,7 +188,7 @@ struct globals {
char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void noresp(int ign UNUSED_PARAM)
{
@@ -398,6 +398,7 @@ struct globals {
#define pingaddr (G.pingaddr )
#define rcvd_tbl (G.rcvd_tbl )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
datalen = DEFDATALEN; \
timeout = MAXWAIT; \
diff --git a/networking/slattach.c b/networking/slattach.c
index d9d8fe7b8..2d1305e32 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -39,7 +39,7 @@ struct globals {
#define handle (G.handle )
#define saved_disc (G.saved_disc )
#define saved_state (G.saved_state )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
/*
diff --git a/networking/tc.c b/networking/tc.c
index 1372ca081..d0bcbdeaa 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -71,6 +71,7 @@ struct globals {
#define filter_prio (G.filter_prio)
#define filter_proto (G.filter_proto)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
diff --git a/networking/tcpudp.c b/networking/tcpudp.c
index 624973042..31bc70459 100644
--- a/networking/tcpudp.c
+++ b/networking/tcpudp.c
@@ -101,6 +101,7 @@ struct globals {
#define env_cur (G.env_cur )
#define env_var (G.env_var )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
cmax = 30; \
env_cur = &env_var[0]; \
} while (0)
diff --git a/networking/telnet.c b/networking/telnet.c
index 2946bc831..d2daf5c8c 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -111,6 +111,7 @@ struct globals {
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 13d5a8f64..13c36aa46 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -85,6 +85,7 @@ struct globals {
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.loginpath = "/bin/login"; \
G.issuefile = "/etc/issue.net"; \
} while (0)
diff --git a/networking/tftp.c b/networking/tftp.c
index 8aeb79aca..e879c4674 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -131,6 +131,7 @@ struct globals {
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c
index 1722a85de..f52a0cf88 100644
--- a/networking/udhcp/dhcprelay.c
+++ b/networking/udhcp/dhcprelay.c
@@ -34,6 +34,7 @@ struct xid_item {
} FIX_ALIASING;
#define dhcprelay_xid_list (*(struct xid_item*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static struct xid_item *xid_add(uint32_t xid, struct sockaddr_in *ip, int client)
{
@@ -257,6 +258,8 @@ int dhcprelay_main(int argc, char **argv)
int num_sockets, max_socket;
uint32_t our_nip;
+ INIT_G();
+
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
server_addr.sin_port = htons(SERVER_PORT);
diff --git a/networking/zcip.c b/networking/zcip.c
index 79643458c..47f3216a0 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -92,7 +92,7 @@ struct globals {
uint32_t localnet_ip;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
/**