diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-04-08 19:47:58 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-08 19:47:58 -0500 |
commit | 8f5459ffbc95476f3bb832b97ada835bcc13c914 (patch) | |
tree | fdce28bec5e1e5980172221adfb60af5d24baf8c /gatchat | |
parent | cad3223a944965be79b81b59207372f4835b7c24 (diff) | |
download | ofono-8f5459ffbc95476f3bb832b97ada835bcc13c914.tar.bz2 |
ppp: Stop the timer when re-starting
In case we receive NAK/REJ we should stop and re-start the timer,
otherwise we end up generating multiple Conf-Reqs
Diffstat (limited to 'gatchat')
-rw-r--r-- | gatchat/ppp_cp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c index 478d62b5..c435ec3a 100644 --- a/gatchat/ppp_cp.c +++ b/gatchat/ppp_cp.c @@ -274,16 +274,6 @@ static gboolean pppcp_timeout(gpointer user_data) return FALSE; } -static void pppcp_start_timer(struct pppcp_timer_data *timer_data) -{ - if (timer_data->restart_timer) - return; - - timer_data->restart_timer = - g_timeout_add_seconds(timer_data->restart_interval, - pppcp_timeout, timer_data); -} - static void pppcp_stop_timer(struct pppcp_timer_data *timer_data) { if (timer_data->restart_timer) { @@ -292,6 +282,15 @@ static void pppcp_stop_timer(struct pppcp_timer_data *timer_data) } } +static void pppcp_start_timer(struct pppcp_timer_data *timer_data) +{ + pppcp_stop_timer(timer_data); + + timer_data->restart_timer = + g_timeout_add_seconds(timer_data->restart_interval, + pppcp_timeout, timer_data); +} + static gboolean is_first_request(struct pppcp_timer_data *timer_data) { return (timer_data->restart_counter == timer_data->max_counter); |