fix: ensure nft backend is only set when available in detect_backend

This commit is contained in:
SunBK201 2025-11-11 17:42:02 +08:00
parent e995349609
commit db4888cd0c

View File

@ -136,16 +136,20 @@ detect_backend() {
if opkg_available; then
if [ "$SERVER_MODE" = "TPROXY" ]; then
if opkg list-installed kmod-nft-tproxy | grep -q 'kmod-nft-tproxy'; then
if nft_available; then
FW_BACKEND="nft"
return 0
fi
else
FW_BACKEND="ipt"
return 0
fi
elif [ "$SERVER_MODE" = "NFQUEUE" ]; then
if opkg list-installed kmod-nft-queue | grep -q 'kmod-nft-queue'; then
if nft_available; then
FW_BACKEND="nft"
return 0
fi
else
FW_BACKEND="ipt"
return 0