summaryrefslogtreecommitdiff
path: root/plugins/telephony.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/telephony.c')
-rw-r--r--plugins/telephony.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/telephony.c b/plugins/telephony.c
index 63e7f6e..ea0bf65 100644
--- a/plugins/telephony.c
+++ b/plugins/telephony.c
@@ -323,6 +323,7 @@ static int __network_connect(struct connman_network *network)
{
struct connman_device *device;
struct telephony_modem *modem;
+ struct telephony_service *service;
DBG("network %p", network);
@@ -334,9 +335,16 @@ static int __network_connect(struct connman_network *network)
if (modem == NULL)
return -ENODEV;
+ service = modem->s_service;
+ if (service == NULL)
+ return -ENOLINK;
+
if (modem->powered == FALSE)
return -ENOLINK;
+ if (modem->data_allowed == FALSE || service->ps_attached == FALSE)
+ return -ENOLINK;
+
return __request_network_activate(network);
}