[LEDE-DEV] * Add support of using device symlinks in network config. For example, it useful when using multiple usb devices that should be bound to certain usb ports. * Add uqmi 'sync' command call to release staled cid when preparing to setup new connection. As a result it prevents 'POLICY MISMATCH' errors.

Nickolay Ledovskikh nledovskikh at gmail.com
Wed Dec 7 08:09:25 PST 2016


Signed-off-by: Nickolay Ledovskikh <nledovskikh at gmail.com>
---
 package/network/utils/comgt/files/directip.sh            | 1 +
 package/network/utils/comgt/files/ncm.sh                 | 2 ++
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 4 ++++
 3 files changed, 7 insertions(+)

diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
index 79b8c32..4dcbd70 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -33,6 +33,7 @@ proto_directip_setup() {
 		return 1
 	}
 
+	device="$(readlink -f $device)"
 	devname="$(basename "$device")"
 	devpath="$(readlink -f /sys/class/tty/$devname/device)"
 	ifname="$( ls "$devpath"/../../*/net )"
diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index 14b6347..917a8c5 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -63,7 +63,9 @@ proto_ncm_setup() {
 		return 1
 	}
 
+	device="$(readlink -f $device)"
 	devname="$(basename "$device")"
+
 	case "$devname" in
 	'tty'*)
 		devpath="$(readlink -f /sys/class/tty/$devname/device)"
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 1235698..3b24539 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -51,6 +51,7 @@ proto_qmi_setup() {
 		return 1
 	}
 
+	device="$(readlink -f $device)"
 	devname="$(basename "$device")"
 	devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
 	ifname="$( ls "$devpath"/net )"
@@ -84,6 +85,7 @@ proto_qmi_setup() {
 
 	# try to clear previous autoconnect state
 	# do not reuse previous wds client id to prevent hangs caused by stale data
+	uqmi -s -d "$device" --sync
 	uqmi -s -d "$device" \
 		--stop-network 0xffffffff \
 		--autoconnect > /dev/null
@@ -213,6 +215,8 @@ qmi_wds_stop() {
 
 	[ -n "$cid" ] || return
 
+	device="$(readlink -f $device)"
+
 	# disable previous autoconnect state using the global handle
 	uqmi -s -d "$device" --set-client-id wds,"$cid" --stop-network "0xffffffff"
 
-- 
2.7.3




More information about the Lede-dev mailing list