Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #553

Merged
merged 3 commits into from
Oct 12, 2024
Merged

sync #553

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1809,24 +1809,26 @@ return view.extend({
o.placeholder = '201';
o.rmempty = true;

if (L.hasSystemFeature('hostapd', 'ocv') || L.hasSystemFeature('wpasupplicant', 'ocv')) {
o = ss.taboption('encryption', form.ListValue, 'ocv', _('Operating Channel Validation'), _("Note: Workaround mode allows a STA that claims OCV capability to connect even if the STA doesn't send OCI or negotiate PMF."));
o.value('0', _('Disabled'));
o.value('1', _('Enabled'));
o.value('2', _('Enabled (workaround mode)'));
o.default = '0';
o.depends('ieee80211w', '1');
o.depends('ieee80211w', '2');

o.validate = function(section_id, value) {
var modeopt = this.section.children.filter(function(o) { return o.option == 'mode' })[0],
modeval = modeopt.formvalue(section_id);

if ((value == '2') && ((modeval == 'sta') || (modeval == 'sta-wds'))) {
return _('Workaround mode can only be used when acting as an access point.');
}
if (not (string.find(uci.get('openmptcprouter','settings','version'), '5.4'))) {
if (L.hasSystemFeature('hostapd', 'ocv') || L.hasSystemFeature('wpasupplicant', 'ocv')) {
o = ss.taboption('encryption', form.ListValue, 'ocv', _('Operating Channel Validation'), _("Note: Workaround mode allows a STA that claims OCV capability to connect even if the STA doesn't send OCI or negotiate PMF."));
o.value('0', _('Disabled'));
o.value('1', _('Enabled'));
o.value('2', _('Enabled (workaround mode)'));
o.default = '0';
o.depends('ieee80211w', '1');
o.depends('ieee80211w', '2');

o.validate = function(section_id, value) {
var modeopt = this.section.children.filter(function(o) { return o.option == 'mode' })[0],
modeval = modeopt.formvalue(section_id);

if ((value == '2') && ((modeval == 'sta') || (modeval == 'sta-wds'))) {
return _('Workaround mode can only be used when acting as an access point.');
}

return true;
return true;
}
}
}

Expand Down
16 changes: 12 additions & 4 deletions omr-bypass/files/etc/init.d/omr-bypass-nft
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ _bypass_proto_without_ndpi() {
set firewall.bypass_$proto_rule=rule
set firewall.bypass_$proto_rule.name="bypass_$proto_rule"
set firewall.bypass_$proto_rule.src='lan'
set firewall.bypass_$proto_rule.proto='all'
set firewall.bypass_$proto_rule.dest='*'
set firewall.bypass_$proto_rule.family='ipv4'
set firewall.bypass_$proto_rule.target='MARK'
Expand All @@ -450,6 +451,7 @@ _bypass_proto_without_ndpi() {
set firewall.bypass6_$proto_rule.src='lan'
set firewall.bypass6_$proto_rule.family='ipv6'
set firewall.bypass6_$proto_rule.dest='*'
set firewall.bypass6_$proto_rule.proto='all'
set firewall.bypass6_$proto_rule.target='MARK'
set firewall.bypass6_$proto_rule.set_xmark="0x6539${intfid}"
set firewall.bypass6_$proto_rule.ipset="bypass6_$proto"
Expand Down Expand Up @@ -645,13 +647,15 @@ _intf_rule() {
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}.family="ipv${ipv46}"
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}.proto='all'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}.set_mark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept=rule
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.name="omr_dst_bypass_${intf}_rule_accept"
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.target='ACCEPT'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.dest='*'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.family="ipv${ipv46}"
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.enabled='0'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.proto='all'
set firewall.omr_dst_bypass_${intf}_dstip_${ipv46}_accept.mark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.name="omr_dst_bypass_${intf}_srcip"
Expand All @@ -660,41 +664,45 @@ _intf_rule() {
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.family="ipv${ipv46}"
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.proto='all'
set firewall.omr_dst_bypass_${intf}_srcip_${ipv46}.set_xmark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.name='omr_dst_bypass_${intf}_mac'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.src='lan'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.proto='all'
set firewall.omr_dst_bypass_${intf}_mac_${ipv46}.set_xmark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.name="omr_dst_bypass_${intf}_srcport"
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.name="omr_dst_bypass_${intf}_srcport_tcp"
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.proto='tcp'
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.src='lan'
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_srcport_tcp_${ipv46}.set_xmark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.name="omr_dst_bypass_${intf}_srcport"
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.name="omr_dst_bypass_${intf}_srcport_udp"
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.proto='udp'
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.src='lan'
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_srcport_udp_${ipv46}.set_xmark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.name="omr_dst_bypass_${intf}_dstport"
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.name="omr_dst_bypass_${intf}_dstport_tcp"
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.src='lan'
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.proto='tcp'
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_dstport_tcp_${ipv46}.set_xmark="0x${ipv46}539${count}"
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}=rule
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.name="omr_dst_bypass_${intf}_dstport"
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.name="omr_dst_bypass_${intf}_dstport_udp"
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.src='lan'
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.dest='*'
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.proto='udp'
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.target='MARK'
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.enabled='0'
set firewall.omr_dst_bypass_${intf}_dstport_udp_${ipv46}.set_xmark="0x${ipv46}539${count}"
Expand Down
2 changes: 1 addition & 1 deletion openmptcprouter-api/files/bin/omr-ip-intf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ get_ip_from_server() {
get_ip() {
serverip=$1
getip="$(curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/clienthost)"
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host')
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host' | sed 's/::ffff://')
if expr "$getip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
ip=$getip
break
Expand Down