aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2021-07-19 19:26:02 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2023-04-29 21:33:04 +0200
commitc1e0d077444b7570d64772338d81db336c94ea94 (patch)
tree5d2cd8e3f18ffbb72d94fad0390660e441a27bbc /package/network
parentc84bf89b3a8f6c93ad30a906b514edcf0077bb51 (diff)
downloadupstream-c1e0d077444b7570d64772338d81db336c94ea94.tar.gz
upstream-c1e0d077444b7570d64772338d81db336c94ea94.tar.bz2
upstream-c1e0d077444b7570d64772338d81db336c94ea94.zip
umbim: inherit firewall zone membership from parent interface
Fix an issue where subinterfaces were not added to the same firewall zone as their parent. Inspired by 64bb88841fb. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Diffstat (limited to 'package/network')
-rwxr-xr-xpackage/network/utils/umbim/files/lib/netifd/proto/mbim.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
index 133c6ef5e6..e7866340ae 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -169,6 +169,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Connected"
+ local zone="$(fw3 -q network "$interface" 2>/dev/null)"
+
if [ -z "$dhcp" -o "$dhcp" = 0 ]; then
echo "mbim[$$]" "Setting up $ifname"
eval $(umbim $DBG -n -t $tid -d $device config | sed 's/: /=/g')
@@ -190,6 +192,7 @@ _proto_mbim_setup() {
[ "$peerdns" = 0 ] || json_add_string "" "$ipv4dnsserver"
json_close_array
proto_add_dynamic_defaults
+ [ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
}
@@ -207,6 +210,7 @@ _proto_mbim_setup() {
[ "$peerdns" = 0 ] || json_add_string "" "$ipv6dnsserver"
json_close_array
proto_add_dynamic_defaults
+ [ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
}
@@ -221,6 +225,7 @@ _proto_mbim_setup() {
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)"
}
@@ -232,6 +237,7 @@ _proto_mbim_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)"
}