Skip to content

Commit

Permalink
luci-app-turboacc: fix for fullconenat (immortalwrt#121)
Browse files Browse the repository at this point in the history
* luci-app-turboacc: drop turboacc_fss

* luci-app-turboacc: disable some firewall zones options

* luci-app-turboacc: add display qca-ecm acceleration engine status
  • Loading branch information
Ailick authored May 17, 2022
1 parent 6698dc8 commit dd4ef9b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 36 deletions.
10 changes: 10 additions & 0 deletions applications/luci-app-turboacc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_DNSPROXY
default n
endef

define Package/$(PKG_NAME)/preinst
#!/bin/sh
sed -i 's/s:option(Flag, "fullcone", translate("Enable FullCone NAT"))/-- e:option(Flag,"fullcone",translate("Enable FullCone NAT"))/g' $${IPKG_INSTROOT}/usr/lib/lua/luci/model/cbi/firewall/zones.lua
endef

define Package/$(PKG_NAME)/postrm
#!/bin/sh
sed -i 's/-- s:option(Flag, "fullcone", translate("Enable FullCone NAT"))/s:option(Flag, "fullcone", translate("Enable FullCone NAT"))/g' $${IPKG_INSTROOT}/usr/lib/lua/luci/model/cbi/firewall/zones.lua
endef

include ../../luci.mk

# call BuildPackage - OpenWrt buildroot signature
27 changes: 17 additions & 10 deletions applications/luci-app-turboacc/root/etc/init.d/turboacc
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ start(){
uci set firewall.@defaults[0].fullcone="${fullcone_nat}"
uci commit firewall

/etc/init.d/turboacc_fss start

[ "${sw_flow}" -ne "1" ] && {
[ "${sfe_flow}" -eq "1" ] && {
[ "$(have_ecm_init)" = "0" ] && {
Expand Down Expand Up @@ -314,24 +312,33 @@ restart(){
}

have_ecm_init() {
[ -d "/etc/init.d/qca-nss-ecm" ] && echo 1 && return
[ -e "/etc/init.d/qca-nss-ecm" ] && echo 1 && return
echo 0
}

ecm_mode(){
config_load "ecm"
config_get front_end global acceleration_engine
case $front_end in
auto | nss | sfe | hybrid)
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && echo 'NSS: Enabled ' || echo 'NSS: Disabled '
[ -d /sys/kernel/debug/ecm/ecm_sfe_ipv4 ] && echo 'SFE: Enabled' || echo 'SFE: Disabled'
;;
*)
echo 'Unknown'
esac
}


check_status(){
case "$1" in
"fastpath")
if [ "$(cat "/sys/module/xt_FLOWOFFLOAD/refcnt" 2>"/dev/null" || echo 0)" -ne "0" ]; then
echo -n "Flow Offloading"
exit 0
elif lsmod | grep -q "ecm"; then
if lsmod | grep -q "shortcut_fe_drv"; then
echo -n "QCA-NSS-ECM-SFE"
exit 0
else
echo -n "QCA-NSS-ECM"
exit 0
fi
echo -n "QCA-ECM Engine: "$(ecm_mode)
exit 0
elif lsmod | grep -q "shortcut_fe_cm"; then
echo -n "Shortcut-FE"
exit 0
Expand Down
26 changes: 0 additions & 26 deletions applications/luci-app-turboacc/root/etc/init.d/turboacc_fss

This file was deleted.

0 comments on commit dd4ef9b

Please sign in to comment.