uqmi: use configured profile-id if available
Use a user-supplied profile-id when configuring the APN and PDP type. Fall back to id "1" in case no profile-id is set by the user. Link: https://github.com/openwrt/openwrt/issues/21617 Suggested-by: S. Hoot <spoot_hoot@protonmail.com> Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
parent
98cadde477
commit
cb4e665da0
@ -39,7 +39,7 @@ proto_qmi_setup() {
|
|||||||
local connstat dataformat mcc mnc plmn_mode
|
local connstat dataformat mcc mnc plmn_mode
|
||||||
local cid_4 cid_6 pdh_4 pdh_6
|
local cid_4 cid_6 pdh_4 pdh_6
|
||||||
local dns1_6 dns2_6 gateway_6 ip_6 ip_prefix_length
|
local dns1_6 dns2_6 gateway_6 ip_6 ip_prefix_length
|
||||||
local profile_pdptype
|
local profile_pdptype profile_id
|
||||||
|
|
||||||
local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
|
local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
|
||||||
json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
|
json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
|
||||||
@ -331,12 +331,13 @@ proto_qmi_setup() {
|
|||||||
|
|
||||||
[ "$pdptype" = "ip" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ip"
|
[ "$pdptype" = "ip" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ip"
|
||||||
|
|
||||||
# Configure PDP type and APN for profile 1.
|
# Configure PDP type and APN.
|
||||||
# In case GGSN rejects IPv4v6 PDP, modem might not be able to
|
# In case GGSN rejects IPv4v6 PDP, modem might not be able to
|
||||||
# establish a non-LTE data session.
|
# establish a non-LTE data session.
|
||||||
profile_pdptype="$pdptype"
|
profile_pdptype="$pdptype"
|
||||||
|
profile_id="${profile:-1}"
|
||||||
[ "$profile_pdptype" = "ip" ] && profile_pdptype="ipv4"
|
[ "$profile_pdptype" = "ip" ] && profile_pdptype="ipv4"
|
||||||
uqmi -s -d "$device" -t 1000 --modify-profile "3gpp,1" --apn "$apn" --pdp-type "$profile_pdptype" > /dev/null 2>&1
|
uqmi -s -d "$device" -t 1000 --modify-profile "3gpp,$profile_id" --apn "$apn" --pdp-type "$profile_pdptype" > /dev/null 2>&1
|
||||||
|
|
||||||
if [ "$pdptype" = "ip" ]; then
|
if [ "$pdptype" = "ip" ]; then
|
||||||
[ -z "$autoconnect" ] && autoconnect=1
|
[ -z "$autoconnect" ] && autoconnect=1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user