While carrying endurance testing of my system, i came accross a problem:
At some point I was unable to get the ppp link up. The problem was that my
device option had changed from /dev/ttyHS5 to ppp0 and so the 3g hotplug
refused to declare the wwan proto as available.

This patch fix this issue.

My test is running the following in a loop on a mini PCIe option modem:
- switch modem on
- wait for GSM registration
- ifup wwan
- ifdown wwan
- switch off modem

Signed-off-by: Christian Gagneraud <ch...@techworks.ie>
---
 package/netifd/files/lib/network/config.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/package/netifd/files/lib/network/config.sh b/package/netifd/files/lib/network/config.sh
index 9128971..61dbae9 100755
--- a/package/netifd/files/lib/network/config.sh
+++ b/package/netifd/files/lib/network/config.sh
@@ -44,7 +44,10 @@ fixup_interface() {
 	config_get device "$config" device "$ifname"
 	[ "bridge" = "$type" ] && ifname="br-$config"
 	config_set "$config" device "$ifname"
-	ubus_call "network.interface.$config" status || return 0
+	ubus_call "network.interface.$config" status || {
+	    config_set "$config" device "$device"
+	    return 0
+	}
 	json_get_var l3dev l3_device
 	[ -n "$l3dev" ] && ifname="$l3dev"
 	json_init
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to