summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2016-04-21 18:18:48 +0200
committerDenys Vlasenko2016-04-21 18:18:48 +0200
commit47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 (patch)
tree05127e986021176649f2dd660a92ef8b8e107e92 /networking
parente6a2f4cc5a47d3022bdf5ca2cacbaa5a8c5baf7a (diff)
downloadbusybox-47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5.zip
busybox-47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5.tar.gz
*: add most of the required setup_common_bufsiz() calls
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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 5f78186..9381eb5 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 52f5ba5..6b0de4d 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 8553a28..360d1e6 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 61bc45c..91fb456 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 399ff6b..25b04c9 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 aa35ffa..8d44b51 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 7616609..cfe6826 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 d9d8fe7..2d1305e 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 1372ca0..d0bcbde 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 6249730..31bc704 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 2946bc8..d2daf5c 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 13d5a8f..13c36aa 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 8aeb79a..e879c46 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 1722a85..f52a0cf 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 7964345..47f3216 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)
/**