Hi Marko, On 12/23/2015 02:52 AM, Marko Šulejić wrote: > * ppp_enter_phase calls ppp_dead if the PPP phase is PPP_PHASE_DEAD > && ppp->sta_pending == FALSE, but fails if sta_pending is never set > to FALSE. So a timeout handler was added to handle this case too. > --- > gatchat/gatppp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c > index 5144084..f84535a 100644 > --- a/gatchat/gatppp.c > +++ b/gatchat/gatppp.c > @@ -361,8 +361,12 @@ static inline void ppp_enter_phase(GAtPPP *ppp, enum ppp_phase phase) > DBG(ppp, "%d", phase); > ppp->phase = phase; > > - if (phase == PPP_PHASE_DEAD && ppp->sta_pending == FALSE) > - ppp->ppp_dead_source = g_idle_add(ppp_dead, ppp); > + if (phase == PPP_PHASE_DEAD) { > + if(ppp->sta_pending) > + ppp->ppp_dead_source = g_timeout_add(5000, ppp_dead, ppp); > + else > + ppp->ppp_dead_source = g_idle_add(ppp_dead, ppp); > + } This seems wrong. sta_pending is set if we are trying to transmit a terminate_ack. If this fails, then the peer is likely severing the connection very shortly afterwards. What is the sequence of events you're observing here? Regards, -Denis