aboutsummaryrefslogtreecommitdiff
path: root/ipsvd/tcpudp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipsvd/tcpudp.c')
-rw-r--r--ipsvd/tcpudp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/ipsvd/tcpudp.c b/ipsvd/tcpudp.c
index 8f23ca640..8f6616fe0 100644
--- a/ipsvd/tcpudp.c
+++ b/ipsvd/tcpudp.c
@@ -163,7 +163,7 @@ static void sig_child_handler(int sig ATTRIBUTE_UNUSED)
163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
164int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv) 164int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
165{ 165{
166 char *str_c, *str_C, *str_b, *str_t; 166 char *str_C, *str_t;
167 char *user; 167 char *user;
168 struct hcc *hccp; 168 struct hcc *hccp;
169 const char *instructs; 169 const char *instructs;
@@ -189,21 +189,20 @@ int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
189 189
190 tcp = (applet_name[0] == 't'); 190 tcp = (applet_name[0] == 't');
191 191
192 /* 3+ args, -i at most once, -p implies -h, -v is counter */ 192 /* 3+ args, -i at most once, -p implies -h, -v is counter, -b N, -c N */
193 opt_complementary = "-3:i--i:ph:vv"; 193 opt_complementary = "-3:i--i:ph:vv:b+:c+";
194#ifdef SSLSVD 194#ifdef SSLSVD
195 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:", 195 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:",
196 &str_c, &str_C, &instructs, &instructs, &user, &preset_local_hostname, 196 &cmax, &str_C, &instructs, &instructs, &user, &preset_local_hostname,
197 &str_b, &str_t, &ssluser, &root, &cert, &key, &verbose 197 &backlog, &str_t, &ssluser, &root, &cert, &key, &verbose
198 ); 198 );
199#else 199#else
200 /* "+": stop on first non-option */
200 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:v", 201 getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:v",
201 &str_c, &str_C, &instructs, &instructs, &user, &preset_local_hostname, 202 &cmax, &str_C, &instructs, &instructs, &user, &preset_local_hostname,
202 &str_b, &str_t, &verbose 203 &backlog, &str_t, &verbose
203 ); 204 );
204#endif 205#endif
205 if (option_mask32 & OPT_c)
206 cmax = xatou_range(str_c, 1, INT_MAX);
207 if (option_mask32 & OPT_C) { /* -C n[:message] */ 206 if (option_mask32 & OPT_C) { /* -C n[:message] */
208 max_per_host = bb_strtou(str_C, &str_C, 10); 207 max_per_host = bb_strtou(str_C, &str_C, 10);
209 if (str_C[0]) { 208 if (str_C[0]) {
@@ -219,8 +218,6 @@ int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
219 if (!get_uidgid(&ugid, user, 1)) 218 if (!get_uidgid(&ugid, user, 1))
220 bb_error_msg_and_die("unknown user/group: %s", user); 219 bb_error_msg_and_die("unknown user/group: %s", user);
221 } 220 }
222 if (option_mask32 & OPT_b)
223 backlog = xatou(str_b);
224#ifdef SSLSVD 221#ifdef SSLSVD
225 if (option_mask32 & OPT_U) ssluser = optarg; 222 if (option_mask32 & OPT_U) ssluser = optarg;
226 if (option_mask32 & OPT_slash) root = optarg; 223 if (option_mask32 & OPT_slash) root = optarg;