All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ppp: fix event generation on close
@ 2010-04-02 17:28 Kristen Carlson Accardi
  2010-04-02 18:07 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Kristen Carlson Accardi @ 2010-04-02 17:28 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]

Prevents too early transition to PPP_DEAD
---
 gatchat/gatppp.c  |    4 +---
 gatchat/ppp.h     |    1 -
 gatchat/ppp_lcp.c |   17 ++++-------------
 3 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 2b853f0..6d4950d 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -419,7 +419,6 @@ static void ppp_transition_phase(GAtPPP *ppp, enum ppp_phase phase)
 		/* otherwise we need to wait for the peer to send us a challenge */
 		break;
 	case PPP_TERMINATION:
-		/* signal DOWN event to LCP */
 		lcp_terminate(ppp->lcp);
 		break;
 	case PPP_DEAD:
@@ -570,8 +569,7 @@ void g_at_ppp_set_recording(GAtPPP *ppp, const char *filename)
 
 void g_at_ppp_shutdown(GAtPPP *ppp)
 {
-	/* send a CLOSE event to the lcp layer */
-	lcp_close(ppp->lcp);
+	ppp_generate_event(ppp, PPP_CLOSING);
 }
 
 void g_at_ppp_ref(GAtPPP *ppp)
diff --git a/gatchat/ppp.h b/gatchat/ppp.h
index ba17f41..8feb2bf 100644
--- a/gatchat/ppp.h
+++ b/gatchat/ppp.h
@@ -153,7 +153,6 @@ gboolean ppp_get_acfc(GAtPPP *ppp);
 struct pppcp_data * lcp_new(GAtPPP *ppp);
 void lcp_free(struct pppcp_data *lcp);
 void lcp_open(struct pppcp_data *data);
-void lcp_close(struct pppcp_data *data);
 void lcp_establish(struct pppcp_data *data);
 void lcp_terminate(struct pppcp_data *data);
 void lcp_protocol_reject(struct pppcp_data *lcp, guint8 *packet, gsize len);
diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index 1fcb40e..e09ed6b 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -71,7 +71,7 @@ static void lcp_up(struct pppcp_data *pppcp)
  */
 static void lcp_down(struct pppcp_data *pppcp)
 {
-	ppp_generate_event(pppcp->ppp, PPP_DOWN);
+	/* XXX should implement a way to signal NCP */
 }
 
 /*
@@ -89,7 +89,7 @@ static void lcp_started(struct pppcp_data *pppcp)
  */
 static void lcp_finished(struct pppcp_data *pppcp)
 {
-	ppp_generate_event(pppcp->ppp, PPP_CLOSING);
+	ppp_generate_event(pppcp->ppp, PPP_DOWN);
 }
 
 /*
@@ -193,15 +193,6 @@ void lcp_open(struct pppcp_data *data)
 	pppcp_generate_event(data, OPEN, NULL, 0);
 }
 
-void lcp_close(struct pppcp_data *data)
-{
-	if (data == NULL)
-		return;
-
-	/* send a CLOSE  event to the lcp layer */
-	pppcp_generate_event(data, CLOSE, NULL, 0);
-}
-
 void lcp_establish(struct pppcp_data *data)
 {
 	if (data == NULL)
@@ -216,8 +207,8 @@ void lcp_terminate(struct pppcp_data *data)
 	if (data == NULL)
 		return;
 
-	/* send a DOWN event to the lcp layer */
-	pppcp_generate_event(data, DOWN, NULL, 0);
+	/* send a CLOSE event to the lcp layer */
+	pppcp_generate_event(data, CLOSE, NULL, 0);
 }
 
 void lcp_free(struct pppcp_data *lcp)
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ppp: fix event generation on close
  2010-04-02 17:28 [PATCH] ppp: fix event generation on close Kristen Carlson Accardi
@ 2010-04-02 18:07 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-04-02 18:07 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

Hi Kristen,

> Prevents too early transition to PPP_DEAD
> ---
>  gatchat/gatppp.c  |    4 +---
>  gatchat/ppp.h     |    1 -
>  gatchat/ppp_lcp.c |   17 ++++-------------
>  3 files changed, 5 insertions(+), 17 deletions(-)

This patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-02 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-02 17:28 [PATCH] ppp: fix event generation on close Kristen Carlson Accardi
2010-04-02 18:07 ` 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.