🦄 Sync 2026-10-29 02:34:23

This commit is contained in:
github-actions[bot] committed 2026-10-29 02:34:23 +08:00
1 parent bfd56813e0
commit e3f5e4d6cc
3 files changed
+19 -4

No files matched your search

@@ -69,6 +69,9 @@ return view.extend({
m = new form.Map('firewall', _('Firewall - Zone Settings'),
_('The firewall creates zones over your network interfaces to control network traffic flow.'));
const hasQualcommECM = runtimeStatus?.ecm_available === true;
if (hasQualcommECM)
m.chain('ecm');
s = m.section(form.TypedSection, 'defaults', _('General Settings'));
s.anonymous = true;
@@ -118,7 +121,7 @@ return view.extend({
/* Netfilter flow offload support */
const hasMediatekHNAT = fw4 && runtimeStatus?.hnat_available === true;
if (L.hasSystemFeature('offloading') || hasMediatekHNAT) {
if (L.hasSystemFeature('offloading') || hasMediatekHNAT || hasQualcommECM) {
s = m.section(form.TypedSection, 'defaults', _('Routing/NAT Offloading'),
_('Not fully compatible with QoS/SQM.'));
@@ -132,11 +135,15 @@ return view.extend({
o.value('2', _("Hardware flow offloading"), _('Hardware based offloading for routing with/without NAT.') + ' ' + _(' Requires hardware NAT support.'));
if (hasMediatekHNAT)
o.value('3', "Mediatek HNAT", "基于Mediatek原厂闭源驱动的HNAT卸载");
if (hasQualcommECM)
o.value('4', 'Qualcomm NSS ECM 加速', 'ECM Auto 模式,自动选择加速引擎。');
o.optional = false;
o.load = function (section_id) {
const flow_offloading = uci.get('firewall', section_id, 'flow_offloading');
const flow_offloading_hw = uci.get('firewall', section_id, 'flow_offloading_hw');
const has_hw_offloading = L.hasSystemFeature('offloading_hw');
if (hasQualcommECM && uci.get('ecm', 'global', 'acceleration_engine') !== 'disabled')
return '4';
if (hasMediatekHNAT && flow_offloading === '3')
return '3';
return (flow_offloading === '1')
@@ -144,6 +151,11 @@ return view.extend({
: '0';
};
o.write = function(section_id, value) {
if (hasQualcommECM) {
if (!uci.get('ecm', 'global'))
uci.add('ecm', 'ecm', 'global');
uci.set('ecm', 'global', 'acceleration_engine', value === '4' ? 'auto' : 'disabled');
}
uci.set('firewall', section_id, 'flow_offloading', value === '3' ? '3' : ((value === '1' || value === '2') ? '1' : '0'));
uci.unset('firewall', section_id, 'mediatek_hnat');
uci.set('firewall', section_id, 'flow_offloading_hw',