proto_config_add_boolean dhcp
proto_config_add_boolean dhcpv6
proto_config_add_string pdptype
+ proto_config_add_int mtu
proto_config_add_defaults
}
local ret
local device apn pincode delay auth username password allow_roaming allow_partner
- local dhcp dhcpv6 pdptype ip4table ip6table $PROTO_DEFAULT_OPTIONS
+ local dhcp dhcpv6 pdptype ip4table ip6table mtu $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
+ json_get_vars dhcp dhcpv6 pdptype ip4table ip6table mtu $PROTO_DEFAULT_OPTIONS
[ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
fi
}
+ [ -z "$mtu" ] && {
+ local ipv4mtu=$(_proto_mbim_get_field ipv4mtu "$mbimconfig")
+ ipv4mtu="${ipv4mtu:-0}"
+ local ipv6mtu=$(_proto_mbim_get_field ipv6mtu "$mbimconfig")
+ ipv6mtu="${ipv6mtu:-0}"
+
+ mtu=$((ipv6mtu > ipv4mtu ? ipv6mtu : ipv4mtu))
+ }
+ [ -n "$mtu" -a "$mtu" != 0 ] && {
+ echo Setting MTU of $ifname to $mtu
+ /sbin/ip link set dev $ifname mtu $mtu
+ }
+
uci_set_state network $interface tid "$tid"
}