aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2021-08-06 22:29:57 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2023-04-29 21:33:04 +0200
commit9ddbcd73d8a6e4251414ff578d1dce1c846bdf4e (patch)
tree12ca591f81312c8f96091ebaf0e76ad0e2fe4133 /package/network/utils
parente2655e0a6beacc45ae763b509cb447d4777aecf6 (diff)
downloadupstream-9ddbcd73d8a6e4251414ff578d1dce1c846bdf4e.tar.gz
upstream-9ddbcd73d8a6e4251414ff578d1dce1c846bdf4e.tar.bz2
upstream-9ddbcd73d8a6e4251414ff578d1dce1c846bdf4e.zip
umbim: pass ipXtable to child interfaces
Inspired by commti e51aa699f7ca, allow setting specific routing tables via ip4table and ip6table options, by passing them on child interfaces created by MBIM protocol handler. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Diffstat (limited to 'package/network/utils')
-rwxr-xr-xpackage/network/utils/umbim/files/lib/netifd/proto/mbim.sh10
1 files changed, 8 insertions, 2 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 aee0feb4ba..fd8b345797 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -31,8 +31,10 @@ _proto_mbim_setup() {
local tid=2
local ret
- local device apn pincode delay allow_roaming allow_partner dhcp dhcpv6 pdptype $PROTO_DEFAULT_OPTIONS
- json_get_vars device apn pincode delay auth username password allow_roaming allow_partner dhcp dhcpv6 pdptype $PROTO_DEFAULT_OPTIONS
+ local device apn pincode delay auth username password allow_roaming allow_partner
+ local dhcp dhcpv6 pdptype ip4table ip6table $PROTO_DEFAULT_OPTIONS
+ json_get_vars device apn pincode delay auth username password allow_roaming allow_partner
+ json_get_vars dhcp dhcpv6 pdptype ip4table ip6table $PROTO_DEFAULT_OPTIONS
[ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
@@ -201,6 +203,7 @@ _proto_mbim_setup() {
json_close_array
proto_add_dynamic_defaults
[ -n "$zone" ] && json_add_string zone "$zone"
+ [ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
json_close_object
ubus call network add_dynamic "$(json_dump)"
elif [ "$dhcp" != 0 ]; then
@@ -211,6 +214,7 @@ _proto_mbim_setup() {
json_add_string proto "dhcp"
proto_add_dynamic_defaults
[ -n "$zone" ] && json_add_string zone "$zone"
+ [ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
json_close_object
ubus call network add_dynamic "$(json_dump)"
fi
@@ -231,6 +235,7 @@ _proto_mbim_setup() {
json_close_array
proto_add_dynamic_defaults
[ -n "$zone" ] && json_add_string zone "$zone"
+ [ -n "$ip6table" ] && json_add_string ip6table "$ip6table"
json_close_object
ubus call network add_dynamic "$(json_dump)"
elif [ "$dhcpv6" != 0 ]; then
@@ -242,6 +247,7 @@ _proto_mbim_setup() {
json_add_string extendprefix 1
proto_add_dynamic_defaults
[ -n "$zone" ] && json_add_string zone "$zone"
+ [ -n "$ip6table" ] && json_add_string ip6table "$ip6table"
json_close_object
ubus call network add_dynamic "$(json_dump)"
fi