summaryrefslogtreecommitdiff
path: root/ipsvd/tcpudp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipsvd/tcpudp.c')
-rw-r--r--ipsvd/tcpudp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipsvd/tcpudp.c b/ipsvd/tcpudp.c
index 492808a6b..e46b3c60e 100644
--- a/ipsvd/tcpudp.c
+++ b/ipsvd/tcpudp.c
@@ -258,7 +258,7 @@ int tcpudpsvd_main(int argc, char **argv)
258#endif 258#endif
259 259
260 if (verbose) { 260 if (verbose) {
261 char *addr = xmalloc_sockaddr2dotted(&lsa->sa, sa_len); 261 char *addr = xmalloc_sockaddr2dotted(&lsa->sa);
262 printf("%s: info: listening on %s", applet_name, addr); 262 printf("%s: info: listening on %s", applet_name, addr);
263 free(addr); 263 free(addr);
264#ifndef SSLSVD 264#ifndef SSLSVD
@@ -302,7 +302,7 @@ int tcpudpsvd_main(int argc, char **argv)
302 if (max_per_host) { 302 if (max_per_host) {
303 /* Drop connection immediately if cur_per_host > max_per_host 303 /* Drop connection immediately if cur_per_host > max_per_host
304 * (minimizing load under SYN flood) */ 304 * (minimizing load under SYN flood) */
305 remote_ip = xmalloc_sockaddr2dotted_noport(&remote.sa, sa_len); 305 remote_ip = xmalloc_sockaddr2dotted_noport(&remote.sa);
306 cur_per_host = ipsvd_perhost_add(remote_ip, max_per_host, &hccp); 306 cur_per_host = ipsvd_perhost_add(remote_ip, max_per_host, &hccp);
307 if (cur_per_host > max_per_host) { 307 if (cur_per_host > max_per_host) {
308 /* ipsvd_perhost_add detected that max is exceeded 308 /* ipsvd_perhost_add detected that max is exceeded
@@ -380,11 +380,11 @@ int tcpudpsvd_main(int argc, char **argv)
380 close(sock); 380 close(sock);
381 381
382 if (need_remote_ip) 382 if (need_remote_ip)
383 remote_addr = xmalloc_sockaddr2dotted(&remote.sa, sa_len); 383 remote_addr = xmalloc_sockaddr2dotted(&remote.sa);
384 384
385 if (need_hostnames) { 385 if (need_hostnames) {
386 if (option_mask32 & OPT_h) { 386 if (option_mask32 & OPT_h) {
387 remote_hostname = xmalloc_sockaddr2host_noport(&remote.sa, sa_len); 387 remote_hostname = xmalloc_sockaddr2host_noport(&remote.sa);
388 if (!remote_hostname) { 388 if (!remote_hostname) {
389 bb_error_msg("warning: cannot look up hostname for %s", remote_addr); 389 bb_error_msg("warning: cannot look up hostname for %s", remote_addr);
390 remote_hostname = (char*)""; 390 remote_hostname = (char*)"";
@@ -397,9 +397,9 @@ int tcpudpsvd_main(int argc, char **argv)
397 local.len = sa_len; 397 local.len = sa_len;
398 getsockname(0, &local.sa, &local.len); 398 getsockname(0, &local.sa, &local.len);
399 } 399 }
400 local_addr = xmalloc_sockaddr2dotted(&local.sa, sa_len); 400 local_addr = xmalloc_sockaddr2dotted(&local.sa);
401 if (!local_hostname) { 401 if (!local_hostname) {
402 local_hostname = xmalloc_sockaddr2host_noport(&local.sa, sa_len); 402 local_hostname = xmalloc_sockaddr2host_noport(&local.sa);
403 if (!local_hostname) 403 if (!local_hostname)
404 bb_error_msg_and_die("warning: cannot look up hostname for %s"+9, local_addr); 404 bb_error_msg_and_die("warning: cannot look up hostname for %s"+9, local_addr);
405 } 405 }
@@ -426,7 +426,7 @@ int tcpudpsvd_main(int argc, char **argv)
426 * an outbond connection to local handler, and it needs 426 * an outbond connection to local handler, and it needs
427 * to know where it originally tried to connect */ 427 * to know where it originally tried to connect */
428 if (tcp && getsockopt(0, SOL_IP, SO_ORIGINAL_DST, &lsa->sa, &lsa->len) == 0) { 428 if (tcp && getsockopt(0, SOL_IP, SO_ORIGINAL_DST, &lsa->sa, &lsa->len) == 0) {
429 char *addr = xmalloc_sockaddr2dotted(&lsa->sa, sa_len); 429 char *addr = xmalloc_sockaddr2dotted(&lsa->sa);
430 xsetenv("TCPORIGDSTADDR", addr); 430 xsetenv("TCPORIGDSTADDR", addr);
431 free(addr); 431 free(addr);
432 } 432 }