#include <limits.h>
#include <linux/netfilter_ipv4.h> /* wants <limits.h> */
-#include "busybox.h"
+#include "libbb.h"
#include "ipsvd_perhost.h"
#ifdef SSLSVD
static void connection_status(void)
{
- /* "only 1 client max" don't need this */
+ /* "only 1 client max" desn't need this */
if (cmax > 1)
printf("%s: info: status %u/%u\n", applet_name, cnum, cmax);
}
tcp = (applet_name[0] == 't');
/* 3+ args, -i at most once, -p implies -h, -v is counter */
- opt_complementary = "-3:?:i--i:ph:vv";
+ opt_complementary = "-3:i--i:ph:vv";
#ifdef SSLSVD
- getopt32(argc, argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:",
+ getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:vU:/:Z:K:",
&str_c, &str_C, &instructs, &instructs, &user, &local_hostname,
&str_b, &str_t, &ssluser, &root, &cert, &key, &verbose
);
#else
- getopt32(argc, argv, "+c:C:i:x:u:l:Eb:hpt:v",
+ getopt32(argv, "+c:C:i:x:u:l:Eb:hpt:v",
&str_c, &str_C, &instructs, &instructs, &user, &local_hostname,
&str_b, &str_t, &verbose
);
#endif
if (verbose) {
- char *addr = xmalloc_sockaddr2dotted(&lsa->sa, sa_len);
+ char *addr = xmalloc_sockaddr2dotted(&lsa->sa);
printf("%s: info: listening on %s", applet_name, addr);
free(addr);
#ifndef SSLSVD
if (max_per_host) {
/* Drop connection immediately if cur_per_host > max_per_host
* (minimizing load under SYN flood) */
- remote_ip = xmalloc_sockaddr2dotted_noport(&remote.sa, sa_len);
+ remote_ip = xmalloc_sockaddr2dotted_noport(&remote.sa);
cur_per_host = ipsvd_perhost_add(remote_ip, max_per_host, &hccp);
if (cur_per_host > max_per_host) {
/* ipsvd_perhost_add detected that max is exceeded
* we cannot replace fd #0 - we will lose pending packet
* which is already buffered for us! And we cannot use fd #1
* instead - it will "intercept" all following packets, but child
- * do not expect data coming *from fd #1*! */
+ * does not expect data coming *from fd #1*! */
#if 0
/* Make it so that local addr is fixed to localp->sa
* and we don't accidentally accept packets to other local IPs. */
close(sock);
if (need_remote_ip)
- remote_addr = xmalloc_sockaddr2dotted(&remote.sa, sa_len);
+ remote_addr = xmalloc_sockaddr2dotted(&remote.sa);
if (need_hostnames) {
if (option_mask32 & OPT_h) {
- remote_hostname = xmalloc_sockaddr2host_noport(&remote.sa, sa_len);
+ remote_hostname = xmalloc_sockaddr2host_noport(&remote.sa);
if (!remote_hostname) {
bb_error_msg("warning: cannot look up hostname for %s", remote_addr);
remote_hostname = (char*)"";
local.len = sa_len;
getsockname(0, &local.sa, &local.len);
}
- local_addr = xmalloc_sockaddr2dotted(&local.sa, sa_len);
+ local_addr = xmalloc_sockaddr2dotted(&local.sa);
if (!local_hostname) {
- local_hostname = xmalloc_sockaddr2host_noport(&local.sa, sa_len);
+ local_hostname = xmalloc_sockaddr2host_noport(&local.sa);
if (!local_hostname)
bb_error_msg_and_die("warning: cannot look up hostname for %s"+9, local_addr);
}
* an outbond connection to local handler, and it needs
* to know where it originally tried to connect */
if (tcp && getsockopt(0, SOL_IP, SO_ORIGINAL_DST, &lsa->sa, &lsa->len) == 0) {
- char *addr = xmalloc_sockaddr2dotted(&lsa->sa, sa_len);
+ char *addr = xmalloc_sockaddr2dotted(&lsa->sa);
xsetenv("TCPORIGDSTADDR", addr);
free(addr);
}