diff --git a/luci/luci-app-qmodem-ttl/luasrc/model/cbi/qmodem/modem_ttl.lua b/luci/luci-app-qmodem-ttl/luasrc/model/cbi/qmodem/modem_ttl.lua index 9f74fa8..be94c81 100644 --- a/luci/luci-app-qmodem-ttl/luasrc/model/cbi/qmodem/modem_ttl.lua +++ b/luci/luci-app-qmodem-ttl/luasrc/model/cbi/qmodem/modem_ttl.lua @@ -1,6 +1,6 @@ local uci = luci.model.uci.cursor() m = Map("qmodem_ttl", translate("TTL Config")) -s = m:section(NamedSection, "global", "global", translate("Global Config")) +s = m:section(NamedSection, "main", "main", translate("Global Config")) enable = s:option(Flag, "enable", translate("Enable")) enable.default = "0" @@ -9,11 +9,5 @@ ttl = s:option(Value, "ttl", translate("TTL")) ttl.default = 64 ttl.datatype = "uinteger" -o = s:option(Value, "ifname", translate("Interface")) -uci:foreach("network", "interface", function(s) - if s[".name"] ~= "loopback" and s[".name"] ~= "lan" then - o:value(s[".name"]) - end -end) return m diff --git a/luci/luci-app-qmodem-ttl/root/etc/config/qmodem_ttl b/luci/luci-app-qmodem-ttl/root/etc/config/qmodem_ttl index 1cc1b61..a057dd0 100644 --- a/luci/luci-app-qmodem-ttl/root/etc/config/qmodem_ttl +++ b/luci/luci-app-qmodem-ttl/root/etc/config/qmodem_ttl @@ -1 +1 @@ -config global 'global' +config main 'main' diff --git a/luci/luci-app-qmodem-ttl/root/etc/init.d/qmodem_ttl b/luci/luci-app-qmodem-ttl/root/etc/init.d/qmodem_ttl index d9f784b..c09eb02 100755 --- a/luci/luci-app-qmodem-ttl/root/etc/init.d/qmodem_ttl +++ b/luci/luci-app-qmodem-ttl/root/etc/init.d/qmodem_ttl @@ -8,7 +8,7 @@ USE_PROCD=1 start_service() { config_load 'qmodem_ttl' - config_get enable 'global' 'enable' '0' + config_get enable 'main' 'enable' '0' if [ "$enable" == 0 ]; then return fi @@ -17,14 +17,10 @@ start_service() set_if_ttl() { - config_get ifname 'global' 'ifname' - config_get ttl 'global' 'ttl' - iface=$(ifstatus $ifname) - json_load "$iface" - json_get_var device device + config_get ttl 'main' 'ttl' IPT="iptables" IPT6="ip6tables" - logger -t modem_ttl "Setting TTL for $device to $ttl" + logger -t modem_ttl "Ovrewirte TTL from br-lan to $ttl" comment="modem_ttl" touch /etc/firewall.d/qmodem_ttl chmod +x /etc/firewall.d/qmodem_ttl @@ -44,10 +40,10 @@ set_if_ttl() if [ -n "$IPT6_POSTROUTING" ]; then ip6tables -t mangle -D POSTROUTING $IPT6_POSTROUTING fi - echo "$IPT -t mangle -A PREROUTING -i $device -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl - echo "$IPT -t mangle -A POSTROUTING -o $device -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl - echo "$IPT6 -t mangle -A PREROUTING -i $device -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl - echo "$IPT6 -t mangle -A POSTROUTING -o $device -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl + echo "$IPT -t mangle -A PREROUTING -i br-lan -j TTL --ttl-set $ttl -m comment --comment $comment" > /etc/firewall.d/qmodem_ttl + echo "$IPT -t mangle -A POSTROUTING -o !br-lan -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl + echo "$IPT6 -t mangle -A PREROUTING -i br-lan -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl + echo "$IPT6 -t mangle -A POSTROUTING -o !br-lan -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl /etc/firewall.d/qmodem_ttl chmod -x /etc/firewall.d/qmodem_ttl [ -d /sys/kernel/debug/ecm/ ] && /etc/init.d/qca-nss-ecm stop # disable nss offload @@ -77,8 +73,6 @@ stop_service(){ service_triggers() { procd_add_reload_trigger "qmodem_ttl" - procd_add_reload_trigger "network" - #netdev } reload_service() diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh index 02658c6..810ee14 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh @@ -449,7 +449,6 @@ set_if() ifdown ${interface6_name} ifup ${interface_name} ifup ${interface6_name} - /etc/init.d/qmodem_ttl start fi if [ "$firewall_reload_flag" -eq 1 ];then uci commit firewall