Browse Source

android: bind v4 server to real interface IP instead of 0.0.0.0

topo_upd
evgeny 2 months ago
parent
commit
ef115e0539
  1. 28
      confdefs.h
  2. 2
      conftest.mk
  3. BIN
      conftest.tar
  4. 2
      tools/chatgui-android/app/src/main/java/com/utun/chat/data/ConfigProvider.kt

28
confdefs.h

@ -0,0 +1,28 @@
/* confdefs.h */
#define PACKAGE_NAME "utun"
#define PACKAGE_TARNAME "utun"
#define PACKAGE_VERSION "2.0.0"
#define PACKAGE_STRING "utun 2.0.0"
#define PACKAGE_BUGREPORT "https://github.com/anomalyco/utun3/issues"
#define PACKAGE_URL ""
#define PACKAGE "utun"
#define VERSION "2.0.0"
#define USE_OPENSSL 1
#define HAVE_ARPA_INET_H 1
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_UNISTD_H 1
#define HAVE_MALLOC 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_MEMSET 1
#define HAVE_SOCKET 1
#define HAVE_STRCHR 1
#define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRSTR 1

2
conftest.mk

@ -0,0 +1,2 @@
conftest.ts1: conftest.ts2
touch conftest.ts2

BIN
conftest.tar

Binary file not shown.

2
tools/chatgui-android/app/src/main/java/com/utun/chat/data/ConfigProvider.kt

@ -307,7 +307,7 @@ class ConfigProvider(private val context: Context) {
for (srv in servers) {
val family = if (srv.bindIp.contains(":")) "v6" else "v4"
appendLine("[server:${srv.ifName}_$family]")
appendLine("addr=${if (family == "v6") "[::]" else "0.0.0.0"}:${srv.port}")
appendLine("addr=${if (family == "v6") "[::]" else srv.bindIp.ifBlank { "0.0.0.0" }}:${srv.port}")
appendLine("type=public")
appendLine("transport=${srv.protocol}")
if (family == "v6") appendLine("netif=${srv.ifName}")

Loading…
Cancel
Save