From 8fd15c7ea624ba143176caeca61fd34cbbb6a195 Mon Sep 17 00:00:00 2001
From: sbwml <admin@cooluc.com>
Date: Fri, 25 Oct 2024 21:04:10 +0800
Subject: [PATCH 6/6] luci-app-firewall: enable hardware offload only on
 devices with `offload_hw` system feature

Signed-off-by: sbwml <admin@cooluc.com>
---
 .../htdocs/luci-static/resources/view/firewall/zones.js       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
index 447c42b..a527abb 100644
--- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
@@ -109,7 +109,9 @@ return view.extend({
 			o = s.option(form.RichListValue, "offloading_type", _("Flow offloading type"));
 			o.value('0', _("None"));
 			o.value('1', _("Software flow offloading"), _('Software based offloading for routing/NAT.'));
-			o.value('2', _("Hardware flow offloading"), _('Hardware based offloading for routing with/without NAT.') + ' ' + _(' Requires hardware NAT support.'));
+			if (L.hasSystemFeature('offload_hw')) {
+				o.value('2', _("Hardware flow offloading"), _('Hardware based offloading for routing with/without NAT.') + ' ' + _(' Requires hardware NAT support.'));
+			}
 			if (L.hasSystemFeature('shortcutfe')) {
 				o.value('3', _("Shortcut-FE flow offloading"), _('Shortcut-FE based offloading for routing/NAT'));
 			}
-- 
2.42.0

