← Commit list

2ea12d8b6

Jeremie Koenig
Jeremie Koenig
2010-07-19
FAILED Duration: 40s

Subject

tcpsvd,udpsvd: conditionalize usage of SO_ORIGINAL_DST

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/Config.src+0 -2
@@ -733,7 +733,6 @@ config SLATTACH
config TCPSVD
bool "tcpsvd"
default y
- depends on PLATFORM_LINUX
help
tcpsvd listens on a TCP port and runs a program for each new
connection.
@@ -966,7 +965,6 @@ config IFUPDOWN_UDHCPC_CMD_OPTIONS
config UDPSVD
bool "udpsvd"
default y
- depends on PLATFORM_LINUX
help
udpsvd listens on an UDP port and runs a program for each new
connection.
networking/tcpudp.c+5 -0
@@ -30,9 +30,12 @@
*/
#include "libbb.h"
+
/* Wants <limits.h> etc, thus included after libbb.h: */
+#ifdef __linux__
#include <linux/types.h> /* for __be32 etc */
#include <linux/netfilter_ipv4.h>
+#endif
// TODO: move into this file:
#include "tcpudp_perhost.h"
@@ -464,6 +467,7 @@ int tcpudpsvd_main(int argc UNUSED_PARAM, char **argv)
/* setup ucspi env */
const char *proto = tcp ? "TCP" : "UDP";
+#ifdef SO_ORIGINAL_DST
/* Extract "original" destination addr:port
* from Linux firewall. Useful when you redirect
* an outbond connection to local handler, and it needs
@@ -473,6 +477,7 @@ int tcpudpsvd_main(int argc UNUSED_PARAM, char **argv)
xsetenv_plain("TCPORIGDSTADDR", addr);
free(addr);
}
+#endif
xsetenv_plain("PROTO", proto);
xsetenv_proto(proto, "LOCALADDR", local_addr);
xsetenv_proto(proto, "REMOTEADDR", remote_addr);