E1750 Reloaded - QMI - STATIC - DHCP - IPv4

poma pomidorabelisima at gmail.com
Sun Aug 10 13:41:00 PDT 2014


Fallback to MM_BEARER_IP_METHOD_DHCP if can't "ping-pong" with the Google Public DNS

---
 src/mm-bearer-qmi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
index c25b9f7..b632b69 100644
--- a/src/mm-bearer-qmi.c
+++ b/src/mm-bearer-qmi.c
@@ -337,6 +337,13 @@ get_ipv4_config (QmiMessageWdsGetCurrentSettingsOutput *output, guint32 mtu)
         mm_dbg ("       MTU: %d", mtu);
     }
 
+    if (system("ping -q -c2 8.8.8.8")) {
+        mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_DHCP);
+        mm_info ("STATIC ain't workin, let's go DHCP");
+    } else {
+        mm_info ("we're staying STATIC, but here we're already connected so someone should check does STATIC actually works");
+    }
+
     return config;
 }
 
-- 
2.0.4


poma




More information about the ModemManager-devel mailing list