1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00
openmptcprouter-feeds/dsvpn/patches/nofirewall.patch
Ycarus (Yannick Chabanois) 86d755cf10 Better patch for dsvpn
2019-08-26 21:06:55 +02:00

35 lines
1.5 KiB
Diff

diff --git a/src/os.c b/src/os.c
index fda9d81..d10d045 100644
--- a/src/os.c
+++ b/src/os.c
@@ -441,7 +441,15 @@ int shell_cmd(const char *substs[][2], const char *args_str, int silent)
Cmds firewall_rules_cmds(int is_server)
{
if (is_server) {
-#ifdef __linux__
+#ifdef defined(OPENWRT_BUILD)
+ static const char
+ *set_cmds[] =
+ { "ip addr add $LOCAL_TUN_IP peer $REMOTE_TUN_IP dev $IF_NAME",
+ "ip -6 addr add $LOCAL_TUN_IP6 peer $REMOTE_TUN_IP6/96 dev $IF_NAME",
+ "ip link set dev $IF_NAME up",
+ NULL },
+ *unset_cmds[] = { NULL, NULL };
+#elif __linux__
static const char
*set_cmds[] =
{ "sysctl net.ipv4.ip_forward=1",
@@ -487,6 +495,13 @@ Cmds firewall_rules_cmds(int is_server)
"route delete 128/1", "route delete -inet6 0000::/1",
"route delete -inet6 8000::/1", NULL
};
+#elif defined(OPENWRT_BUILD)
+ static const char
+ *set_cmds[] = { "ip link set dev $IF_NAME up",
+ "ip addr add $LOCAL_TUN_IP peer $REMOTE_TUN_IP dev $IF_NAME",
+ "ip -6 addr add $LOCAL_TUN_IP6 peer $REMOTE_TUN_IP6/96 dev $IF_NAME",
+ NULL },
+ *unset_cmds[] = { NULL, NULL };
#elif defined(__linux__)
static const char
*set_cmds[] = { "sysctl net.ipv4.tcp_congestion_control=bbr",