When 2/3G modem is online, MobileContryCode will be updated to all devices 
including wifi.
If wifi isn't enabled, the interface->path of wifi isn't available.
It result in the crash after 2/3G modem is online.

[PATCH 1]: Adding the interface to make sure if the device is enabled or not in 
device.c and device.h.
[PATCH 2]: Adding the controlled conditions in wifi.c

connmand[6761]: plugins/ofono.c:get_properties_reply() /huawei_0 path /huawei_0 
org.ofono.NetworkRegistration
connmand[6761]: plugins/ofono.c:netreg_properties_reply() /huawei_0
connmand[6761]: plugins/ofono.c:netreg_update_regdom() /huawei_0 
MobileContryCode 460
connmand[6761]: src/device.c:connman_device_ref_debug() 0x8686ac0 ref 3 by 
plugins/wifi.c:991:wifi_set_regdom()
connmand[6761]: Aborting (signal 11) [src/connmand]
connmand[6761]: ++++++++ backtrace ++++++++
connmand[6761]: #0  0xb7749400 in 
connmand[6761]: #1  0x806aa0b in g_supplicant_interface_set_country() at nat.c:0
connmand[6761]: #2  0x8062297 in wifi_set_regdom() at wifi.c:0
connmand[6761]: #3  0x80a607d in connman_technology_set_regdom() at ??:0
connmand[6761]: #4  0x806fefb in netreg_update_regdom() at ofono.c:0
connmand[6761]: #5  0x8071f3b in netreg_properties_reply() at ofono.c:0
connmand[6761]: #6  0x806f747 in get_properties_reply() at ofono.c:0
connmand[6761]: #7  0x4a374b62 in /usr/lib/libdbus-1.so.3
connmand[6761]: #8  0x4a3602b7 in /usr/lib/libdbus-1.so.3
connmand[6761]: #9  0x4a3639f5 in /usr/lib/libdbus-1.so.3
connmand[6761]: #10 0x8054250 in message_dispatch() at mainloop.c:0
connmand[6761]: #11 0x49f3e9d7 in /lib/libglib-2.0.so.0
connmand[6761]: #12 0x49f3de38 in /lib/libglib-2.0.so.0
connmand[6761]: #13 0x49f3e13e in /lib/libglib-2.0.so.0
connmand[6761]: #14 0x49f3e5a6 in /lib/libglib-2.0.so.0
connmand[6761]: #15 0x8053ab6 in main() at nat.c:0
connmand[6761]: #16 0x49cfc4c4 in /lib/libc.so.6
connmand[6761]: +++++++++++++++++++++++++++

---
 include/device.h |    1 +
 src/device.c     |   11 +++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/device.h b/include/device.h
index d066296..d2f4f94 100644
--- a/include/device.h
+++ b/include/device.h
@@ -78,6 +78,7 @@ void connman_device_set_ident(struct connman_device *device,
                                                const char *ident);
 const char *connman_device_get_ident(struct connman_device *device);
 
+connman_bool_t connman_device_get_powered(struct connman_device *device);
 int connman_device_set_powered(struct connman_device *device,
                                                connman_bool_t powered);
 int connman_device_set_scanning(struct connman_device *device,
diff --git a/src/device.c b/src/device.c
index 75fa7f7..28ea2a7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -569,6 +569,17 @@ const char *connman_device_get_ident(struct connman_device 
*device)
 }
 
 /**
+ * connman_device_get_powered:
+ * @device: device structure
+ *
+ * Get power state of device
+ */
+connman_bool_t connman_device_get_powered(struct connman_device *device)
+{
+       return device->powered;
+}
+
+/**
  * connman_device_set_powered:
  * @device: device structure
  * @powered: powered state
-- 
1.7.7

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to