aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-11-14 12:49:45 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-06-27 14:18:52 +0200
commit3dc740257b25547c2a0304f6c710b37dcb623d7d (patch)
tree7e93011fda59b5137920b823b97fe134b7b01777
parenta2c22b8776e7db11582d7745d1b573e5af015673 (diff)
downloadupstream-3dc740257b25547c2a0304f6c710b37dcb623d7d.tar.gz
upstream-3dc740257b25547c2a0304f6c710b37dcb623d7d.tar.bz2
upstream-3dc740257b25547c2a0304f6c710b37dcb623d7d.zip
uqmi: inherit firewall zone membership to virtual sub interfaces
Fix an issue where subinterfaces were not added to the same firewall zone as their parent. Fixes: FS#2122 Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com> (cherry picked from commit 64bb88841fbc2d9a9dfee12775a18e5dc89ac16e)
-rw-r--r--package/network/utils/comgt/files/ncm.sh10
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh10
2 files changed, 20 insertions, 0 deletions
diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index 60b39655ec..9aaaa25f37 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -146,12 +146,18 @@ proto_ncm_setup() {
proto_close_data
proto_send_update "$interface"
+ local zone="$(fw3 -q network "$interface" 2>/dev/null)"
+
[ "$pdptype" = "IP" -o "$pdptype" = "IPV4V6" ] && {
json_init
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
json_add_string proto "dhcp"
proto_add_dynamic_defaults
+ [ -n "$zone" ] && {
+ json_add_string zone "$zone"
+ }
+ json_close_object
ubus call network add_dynamic "$(json_dump)"
}
@@ -162,6 +168,10 @@ proto_ncm_setup() {
json_add_string proto "dhcpv6"
json_add_string extendprefix 1
proto_add_dynamic_defaults
+ [ -n "$zone" ] && {
+ json_add_string zone "$zone"
+ }
+ json_close_object
ubus call network add_dynamic "$(json_dump)"
}
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 1da98db5ac..f4b30b87eb 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -298,6 +298,9 @@ proto_qmi_setup() {
}
proto_close_data
proto_send_update "$interface"
+
+ local zone="$(fw3 -q network "$interface" 2>/dev/null)"
+
[ -n "$pdh_6" ] && {
if [ -z "$dhcpv6" -o "$dhcpv6" = 0 ]; then
json_load "$(uqmi -s -d $device --set-client-id wds,$cid_6 --get-current-settings)"
@@ -318,6 +321,11 @@ proto_qmi_setup() {
proto_add_dns_server "$dns1_6"
proto_add_dns_server "$dns2_6"
}
+ [ -n "$zone" ] && {
+ proto_add_data
+ json_add_string zone "$zone"
+ proto_close_data
+ }
proto_send_update "$interface"
else
json_init
@@ -328,6 +336,7 @@ proto_qmi_setup() {
proto_add_dynamic_defaults
# RFC 7278: Extend an IPv6 /64 Prefix to LAN
json_add_string extendprefix 1
+ [ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
fi
@@ -340,6 +349,7 @@ proto_qmi_setup() {
json_add_string proto "dhcp"
[ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
proto_add_dynamic_defaults
+ [ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
}