From e2f848c2d979363c16fb9ca4e13bae97348a68b3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 12:52:45 -0700 Subject: [PATCH] bt: ensure connect timeout is canceled on success (rh #586961) --- src/nm-device-bt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index ef2c98db0e..7d9c952ea8 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -576,13 +576,17 @@ check_connect_continue (NMDeviceBt *self) nm_device_get_ip_iface (device), dun ? "DUN" : (pan ? "PAN" : "unknown")); + /* Kill the connect timeout since we're connected now */ + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + if (pan) { /* Bluez says we're connected now. Start IP config. */ nm_device_activate_schedule_stage3_ip_config_start (device); } else if (dun) { /* Wait for ModemManager to find the modem */ - if (priv->timeout_id) - g_source_remove (priv->timeout_id); priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); nm_log_info (LOGD_BT | LOGD_MB, "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) "