From a01940cda8a29ca8b0b6573422a7811e1ff218c0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 15 Feb 2009 22:30:15 -0500 Subject: [PATCH] hso: fix repeated secrets requests Secrets attempts never got reset. --- src/nm-hso-gsm-device.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nm-hso-gsm-device.c b/src/nm-hso-gsm-device.c index 15032a3c15..bb52c84c95 100644 --- a/src/nm-hso-gsm-device.c +++ b/src/nm-hso-gsm-device.c @@ -356,6 +356,7 @@ static NMActStageReturn real_act_stage3_ip_config_start (NMDevice *device, NMDeviceStateReason *reason) { NMActRequest *req; + NMConnection *connection; char *command; gint cid; const char *responses[] = { "_OWANDATA: ", NULL }; @@ -364,6 +365,10 @@ real_act_stage3_ip_config_start (NMDevice *device, NMDeviceStateReason *reason) req = nm_device_get_act_request (device); g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + g_object_set_data (G_OBJECT (connection), HSO_SECRETS_TRIES, NULL); + cid = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (req), GSM_CID)); command = g_strdup_printf ("AT_OWANDATA=%d", cid); modem_wait_for_reply (NM_GSM_DEVICE (device), command, 5, responses, terminators, hso_ip4_config_response, NULL); @@ -420,6 +425,7 @@ real_deactivate_quickly (NMDevice *device) { NMHsoGsmDevicePrivate *priv = NM_HSO_GSM_DEVICE_GET_PRIVATE (device); NMActRequest *req; + NMConnection *connection; guint cid; char *command; @@ -444,6 +450,11 @@ real_deactivate_quickly (NMDevice *device) reply = nm_serial_device_wait_reply_blocking (NM_SERIAL_DEVICE (device), 5, responses, responses); g_free (command); } + + /* Clear the secrets attempts counter */ + connection = nm_act_request_get_connection (req); + g_assert (connection); + g_object_set_data (G_OBJECT (connection), HSO_SECRETS_TRIES, NULL); } if (NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate_quickly)