From 1a11af0f86cee0ca24861a8369782627906363d1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 19 Feb 2013 09:50:52 +0100 Subject: [PATCH] broadband-bearer: fallback to primary AT port if no data AT port available Spotted by Dan Williams with his ADU960S. --- src/mm-broadband-bearer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index 61dedbd9..eeaebd07 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -183,11 +183,11 @@ common_get_at_data_port (MMBaseModem *modem, /* Look for best data port, NULL if none available. */ data = mm_base_modem_peek_best_data_port (modem, MM_PORT_TYPE_AT); if (!data) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_CONNECTED, - "Couldn't connect: no port available"); - return NULL; + /* It may happen that the desired data port grabbed during probing was + * actually a 'net' port, which the generic logic cannot handle, so if + * that is the case, and we have no AT data ports specified, just + fallback to the primary AT port. */ + data = (MMPort *) mm_base_modem_peek_port_primary (modem); } g_assert (MM_IS_AT_SERIAL_PORT (data));