mirror of git://git.sysmocom.de/ofono
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
This commit is contained in:
parent
cad3223a94
commit
8f5459ffbc
|
@ -274,16 +274,6 @@ static gboolean pppcp_timeout(gpointer user_data)
|
||||||
return FALSE;
|
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)
|
static void pppcp_stop_timer(struct pppcp_timer_data *timer_data)
|
||||||
{
|
{
|
||||||
if (timer_data->restart_timer) {
|
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)
|
static gboolean is_first_request(struct pppcp_timer_data *timer_data)
|
||||||
{
|
{
|
||||||
return (timer_data->restart_counter == timer_data->max_counter);
|
return (timer_data->restart_counter == timer_data->max_counter);
|
||||||
|
|
Loading…
Reference in New Issue