diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/arp.c | 1 | ||||
-rw-r--r-- | networking/arping.c | 1 | ||||
-rw-r--r-- | networking/ftpd.c | 1 | ||||
-rw-r--r-- | networking/ftpgetput.c | 1 | ||||
-rw-r--r-- | networking/ifupdown.c | 2 | ||||
-rw-r--r-- | networking/inetd.c | 1 | ||||
-rw-r--r-- | networking/ping.c | 3 | ||||
-rw-r--r-- | networking/slattach.c | 2 | ||||
-rw-r--r-- | networking/tc.c | 1 | ||||
-rw-r--r-- | networking/tcpudp.c | 1 | ||||
-rw-r--r-- | networking/telnet.c | 1 | ||||
-rw-r--r-- | networking/telnetd.c | 1 | ||||
-rw-r--r-- | networking/tftp.c | 1 | ||||
-rw-r--r-- | networking/udhcp/dhcprelay.c | 3 | ||||
-rw-r--r-- | networking/zcip.c | 2 |
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 { | |||
76 | #define device (G.device ) | 76 | #define device (G.device ) |
77 | #define hw_set (G.hw_set ) | 77 | #define hw_set (G.hw_set ) |
78 | #define INIT_G() do { \ | 78 | #define INIT_G() do { \ |
79 | setup_common_bufsiz(); \ | ||
79 | device = ""; \ | 80 | device = ""; \ |
80 | } while (0) | 81 | } while (0) |
81 | 82 | ||
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 { | |||
77 | #define brd_recv (G.brd_recv ) | 77 | #define brd_recv (G.brd_recv ) |
78 | #define req_recv (G.req_recv ) | 78 | #define req_recv (G.req_recv ) |
79 | #define INIT_G() do { \ | 79 | #define INIT_G() do { \ |
80 | setup_common_bufsiz(); \ | ||
80 | count = -1; \ | 81 | count = -1; \ |
81 | } while (0) | 82 | } while (0) |
82 | 83 | ||
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 { | |||
126 | } FIX_ALIASING; | 126 | } FIX_ALIASING; |
127 | #define G (*(struct globals*)bb_common_bufsiz1) | 127 | #define G (*(struct globals*)bb_common_bufsiz1) |
128 | #define INIT_G() do { \ | 128 | #define INIT_G() do { \ |
129 | setup_common_bufsiz(); \ | ||
129 | /* Moved to main */ \ | 130 | /* Moved to main */ \ |
130 | /*strcpy(G.msg_ok + 4, MSG_OK );*/ \ | 131 | /*strcpy(G.msg_ok + 4, MSG_OK );*/ \ |
131 | /*strcpy(G.msg_err + 4, MSG_ERR);*/ \ | 132 | /*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) }; | |||
71 | #define do_continue (G.do_continue ) | 71 | #define do_continue (G.do_continue ) |
72 | #define buf (G.buf ) | 72 | #define buf (G.buf ) |
73 | #define INIT_G() do { \ | 73 | #define INIT_G() do { \ |
74 | setup_common_bufsiz(); \ | ||
74 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 75 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
75 | } while (0) | 76 | } while (0) |
76 | 77 | ||
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 { | |||
131 | char *shell; | 131 | char *shell; |
132 | } FIX_ALIASING; | 132 | } FIX_ALIASING; |
133 | #define G (*(struct globals*)bb_common_bufsiz1) | 133 | #define G (*(struct globals*)bb_common_bufsiz1) |
134 | #define INIT_G() do { } while (0) | 134 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
135 | 135 | ||
136 | 136 | ||
137 | static const char keywords_up_down[] ALIGN1 = | 137 | 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) }; | |||
350 | #define allsock (G.allsock ) | 350 | #define allsock (G.allsock ) |
351 | #define line (G.line ) | 351 | #define line (G.line ) |
352 | #define INIT_G() do { \ | 352 | #define INIT_G() do { \ |
353 | setup_common_bufsiz(); \ | ||
353 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 354 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
354 | rlim_ofile_cur = OPEN_MAX; \ | 355 | rlim_ofile_cur = OPEN_MAX; \ |
355 | global_queuelen = 128; \ | 356 | 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 { | |||
188 | char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; | 188 | char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; |
189 | } FIX_ALIASING; | 189 | } FIX_ALIASING; |
190 | #define G (*(struct globals*)bb_common_bufsiz1) | 190 | #define G (*(struct globals*)bb_common_bufsiz1) |
191 | #define INIT_G() do { } while (0) | 191 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
192 | 192 | ||
193 | static void noresp(int ign UNUSED_PARAM) | 193 | static void noresp(int ign UNUSED_PARAM) |
194 | { | 194 | { |
@@ -398,6 +398,7 @@ struct globals { | |||
398 | #define pingaddr (G.pingaddr ) | 398 | #define pingaddr (G.pingaddr ) |
399 | #define rcvd_tbl (G.rcvd_tbl ) | 399 | #define rcvd_tbl (G.rcvd_tbl ) |
400 | #define INIT_G() do { \ | 400 | #define INIT_G() do { \ |
401 | setup_common_bufsiz(); \ | ||
401 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 402 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
402 | datalen = DEFDATALEN; \ | 403 | datalen = DEFDATALEN; \ |
403 | timeout = MAXWAIT; \ | 404 | 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 { | |||
39 | #define handle (G.handle ) | 39 | #define handle (G.handle ) |
40 | #define saved_disc (G.saved_disc ) | 40 | #define saved_disc (G.saved_disc ) |
41 | #define saved_state (G.saved_state ) | 41 | #define saved_state (G.saved_state ) |
42 | #define INIT_G() do { } while (0) | 42 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
43 | 43 | ||
44 | 44 | ||
45 | /* | 45 | /* |
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 { | |||
71 | #define filter_prio (G.filter_prio) | 71 | #define filter_prio (G.filter_prio) |
72 | #define filter_proto (G.filter_proto) | 72 | #define filter_proto (G.filter_proto) |
73 | #define INIT_G() do { \ | 73 | #define INIT_G() do { \ |
74 | setup_common_bufsiz(); \ | ||
74 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 75 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
75 | } while (0) | 76 | } while (0) |
76 | 77 | ||
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 { | |||
101 | #define env_cur (G.env_cur ) | 101 | #define env_cur (G.env_cur ) |
102 | #define env_var (G.env_var ) | 102 | #define env_var (G.env_var ) |
103 | #define INIT_G() do { \ | 103 | #define INIT_G() do { \ |
104 | setup_common_bufsiz(); \ | ||
104 | cmax = 30; \ | 105 | cmax = 30; \ |
105 | env_cur = &env_var[0]; \ | 106 | env_cur = &env_var[0]; \ |
106 | } while (0) | 107 | } 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 { | |||
111 | } FIX_ALIASING; | 111 | } FIX_ALIASING; |
112 | #define G (*(struct globals*)bb_common_bufsiz1) | 112 | #define G (*(struct globals*)bb_common_bufsiz1) |
113 | #define INIT_G() do { \ | 113 | #define INIT_G() do { \ |
114 | setup_common_bufsiz(); \ | ||
114 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 115 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
115 | } while (0) | 116 | } while (0) |
116 | 117 | ||
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 { | |||
85 | } FIX_ALIASING; | 85 | } FIX_ALIASING; |
86 | #define G (*(struct globals*)bb_common_bufsiz1) | 86 | #define G (*(struct globals*)bb_common_bufsiz1) |
87 | #define INIT_G() do { \ | 87 | #define INIT_G() do { \ |
88 | setup_common_bufsiz(); \ | ||
88 | G.loginpath = "/bin/login"; \ | 89 | G.loginpath = "/bin/login"; \ |
89 | G.issuefile = "/etc/issue.net"; \ | 90 | G.issuefile = "/etc/issue.net"; \ |
90 | } while (0) | 91 | } 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 { | |||
131 | } FIX_ALIASING; | 131 | } FIX_ALIASING; |
132 | #define G (*(struct globals*)bb_common_bufsiz1) | 132 | #define G (*(struct globals*)bb_common_bufsiz1) |
133 | #define INIT_G() do { \ | 133 | #define INIT_G() do { \ |
134 | setup_common_bufsiz(); \ | ||
134 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 135 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
135 | } while (0) | 136 | } while (0) |
136 | 137 | ||
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 { | |||
34 | } FIX_ALIASING; | 34 | } FIX_ALIASING; |
35 | 35 | ||
36 | #define dhcprelay_xid_list (*(struct xid_item*)bb_common_bufsiz1) | 36 | #define dhcprelay_xid_list (*(struct xid_item*)bb_common_bufsiz1) |
37 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
37 | 38 | ||
38 | static struct xid_item *xid_add(uint32_t xid, struct sockaddr_in *ip, int client) | 39 | static struct xid_item *xid_add(uint32_t xid, struct sockaddr_in *ip, int client) |
39 | { | 40 | { |
@@ -257,6 +258,8 @@ int dhcprelay_main(int argc, char **argv) | |||
257 | int num_sockets, max_socket; | 258 | int num_sockets, max_socket; |
258 | uint32_t our_nip; | 259 | uint32_t our_nip; |
259 | 260 | ||
261 | INIT_G(); | ||
262 | |||
260 | server_addr.sin_family = AF_INET; | 263 | server_addr.sin_family = AF_INET; |
261 | server_addr.sin_addr.s_addr = htonl(INADDR_BROADCAST); | 264 | server_addr.sin_addr.s_addr = htonl(INADDR_BROADCAST); |
262 | server_addr.sin_port = htons(SERVER_PORT); | 265 | 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 { | |||
92 | uint32_t localnet_ip; | 92 | uint32_t localnet_ip; |
93 | } FIX_ALIASING; | 93 | } FIX_ALIASING; |
94 | #define G (*(struct globals*)bb_common_bufsiz1) | 94 | #define G (*(struct globals*)bb_common_bufsiz1) |
95 | #define INIT_G() do { } while (0) | 95 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
96 | 96 | ||
97 | 97 | ||
98 | /** | 98 | /** |