aredn/patches/709-iperf-fw-restart.patch

47 lines
1.6 KiB
Diff

Index: openwrt/package/network/utils/iperf3/Makefile
===================================================================
--- openwrt.orig/package/network/utils/iperf3/Makefile
+++ openwrt/package/network/utils/iperf3/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=iperf
PKG_VERSION:=3.7
-PKG_RELEASE:=1
+PKG_RELEASE:=1AREDN
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf
@@ -72,6 +72,18 @@ endef
define Package/iperf3/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc/local/mesh-firewall
+ $(INSTALL_BIN) ./files/iperf.firewall $(1)/etc/local/mesh-firewall/20-iperf3
+endef
+
+define Package/iperf3/postinst
+#!/bin/sh
+# check if we are on real system
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ echo "Restarting Firewall"
+ /etc/init.d/firewall restart
+fi
+exit 0
endef
define Package/iperf3-ssl/install
Index: openwrt/package/network/utils/iperf3/files/iperf.firewall
===================================================================
--- /dev/null
+++ openwrt/package/network/utils/iperf3/files/iperf.firewall
@@ -0,0 +1,9 @@
+#!/bin/sh
+iptables -I zone_wifi_input -p udp -m udp --dport 5201 -j ACCEPT
+iptables -I zone_wifi_input -p tcp -m tcp --dport 5201 -j ACCEPT
+iptables -I zone_dtdlink_input -p udp -m udp --dport 5201 -j ACCEPT
+iptables -I zone_dtdlink_input -p tcp -m tcp --dport 5201 -j ACCEPT
+if [ "$MESHFW_TUNNELS_ENABLED" == "1" ]; then
+ iptables -I zone_vpn_input -p udp -m udp --dport 5201 -j ACCEPT
+ iptables -I zone_vpn_input -p tcp -m tcp --dport 5201 -j ACCEPT
+fi