* [PATCH] ppp: transition phase to DEAD when lcp finishes
@ 2010-05-03 22:23 Kristen Carlson Accardi
2010-05-10 14:21 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-03 22:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
change the state to DEAD when lcp finishes. This prevents us from
calling our disconnect function again if we are already dead.
---
gatchat/gatppp.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 70669b0..dd6d84d 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -186,9 +186,6 @@ static inline void ppp_enter_phase(GAtPPP *ppp, enum ppp_phase phase)
{
g_print("Entering new phase: %d\n", phase);
ppp->phase = phase;
-
- if (phase == PPP_PHASE_DEAD)
- ppp_dead(ppp);
}
void ppp_set_auth(GAtPPP *ppp, const guint8* auth_data)
@@ -290,6 +287,10 @@ void ppp_lcp_down_notify(GAtPPP *ppp)
void ppp_lcp_finished_notify(GAtPPP *ppp)
{
+ if (ppp->phase == PPP_PHASE_DEAD)
+ return;
+
+ ppp_enter_phase(ppp, PPP_PHASE_DEAD);
ppp_dead(ppp);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ppp: transition phase to DEAD when lcp finishes
2010-05-03 22:23 [PATCH] ppp: transition phase to DEAD when lcp finishes Kristen Carlson Accardi
@ 2010-05-10 14:21 ` Denis Kenzior
2010-05-10 17:08 ` Kristen Carlson Accardi
0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2010-05-10 14:21 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
Hi Kristen,
> change the state to DEAD when lcp finishes. This prevents us from
> calling our disconnect function again if we are already dead.
I'm curious under what circumstances tlf gets called on LCP when we're already
down?
> ---
> gatchat/gatppp.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
> index 70669b0..dd6d84d 100644
> --- a/gatchat/gatppp.c
> +++ b/gatchat/gatppp.c
> @@ -186,9 +186,6 @@ static inline void ppp_enter_phase(GAtPPP *ppp, enum
> ppp_phase phase) {
> g_print("Entering new phase: %d\n", phase);
> ppp->phase = phase;
> -
> - if (phase == PPP_PHASE_DEAD)
> - ppp_dead(ppp);
> }
>
> void ppp_set_auth(GAtPPP *ppp, const guint8* auth_data)
> @@ -290,6 +287,10 @@ void ppp_lcp_down_notify(GAtPPP *ppp)
>
> void ppp_lcp_finished_notify(GAtPPP *ppp)
> {
> + if (ppp->phase == PPP_PHASE_DEAD)
> + return;
I prefer we move this to ppp_enter_phase
> +
> + ppp_enter_phase(ppp, PPP_PHASE_DEAD);
Keep this
> ppp_dead(ppp);
And remove this.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ppp: transition phase to DEAD when lcp finishes
2010-05-10 14:21 ` Denis Kenzior
@ 2010-05-10 17:08 ` Kristen Carlson Accardi
2010-05-10 17:19 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-10 17:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 728 bytes --]
On Mon, 10 May 2010 09:21:37 -0500
Denis Kenzior <denkenz@gmail.com> wrote:
> Hi Kristen,
>
> > change the state to DEAD when lcp finishes. This prevents us from
> > calling our disconnect function again if we are already dead.
>
> I'm curious under what circumstances tlf gets called on LCP when we're already
> down?
A timeout after sending a terminate ack causes a tlf and switches us
to the STOPPED state. disconnect function is called at tlf, and
disconnect reason correctly set. Then, our read watcher is destroyed and
we signal down (transitions us to state STARTING) and close (calls tlf
and transitions us to INITIAL). Disconnect function is called with
disconnect reason set to link dead.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppp: transition phase to DEAD when lcp finishes
2010-05-10 17:08 ` Kristen Carlson Accardi
@ 2010-05-10 17:19 ` Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2010-05-10 17:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
Hi Kristen,
> On Mon, 10 May 2010 09:21:37 -0500
>
> Denis Kenzior <denkenz@gmail.com> wrote:
> > Hi Kristen,
> >
> > > change the state to DEAD when lcp finishes. This prevents us from
> > > calling our disconnect function again if we are already dead.
> >
> > I'm curious under what circumstances tlf gets called on LCP when we're
> > already down?
>
> A timeout after sending a terminate ack causes a tlf and switches us
> to the STOPPED state. disconnect function is called at tlf, and
> disconnect reason correctly set. Then, our read watcher is destroyed and
> we signal down (transitions us to state STARTING) and close (calls tlf
> and transitions us to INITIAL). Disconnect function is called with
> disconnect reason set to link dead.
>
Ah yes, the silly Huawei hardware. Sounds like we should ignore GAtIO
disconnects when we're already in PPP_DEAD phase.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-10 17:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-03 22:23 [PATCH] ppp: transition phase to DEAD when lcp finishes Kristen Carlson Accardi
2010-05-10 14:21 ` Denis Kenzior
2010-05-10 17:08 ` Kristen Carlson Accardi
2010-05-10 17:19 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.