summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_lcp.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-13 13:34:12 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-13 13:34:12 -0500
commitdbbaa3c416db7c404bdf167c7984fe0777367438 (patch)
tree73958ba2cf4cb8654164668ec86c50fda50c3411 /gatchat/ppp_lcp.c
parent8c1677713fa24b34d2ad93743b0bb7fe0a430bb7 (diff)
downloadofono-dbbaa3c416db7c404bdf167c7984fe0777367438.tar.bz2
ppp: Reset the options whenever the layer is down
So we can re-negotiate the options if the layer is opened again.
Diffstat (limited to 'gatchat/ppp_lcp.c')
-rw-r--r--gatchat/ppp_lcp.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index 304a72c2..e945fea8 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -90,6 +90,14 @@ static void lcp_generate_config_options(struct lcp_data *lcp)
lcp->options_len = len;
}
+static void lcp_reset_config_options(struct lcp_data *lcp)
+{
+ lcp->req_options = REQ_OPTION_ACCM;
+ lcp->accm = 0;
+
+ lcp_generate_config_options(lcp);
+}
+
/*
* signal the Up event to the NCP
*/
@@ -103,7 +111,10 @@ static void lcp_up(struct pppcp_data *pppcp)
*/
static void lcp_down(struct pppcp_data *pppcp)
{
- /* XXX should implement a way to signal NCP */
+ struct lcp_data *lcp = pppcp_get_data(pppcp);
+
+ lcp_reset_local_options(lcp);
+ pppcp_set_local_options(pppcp, lcp->options, lcp->options_len);
}
/*
@@ -255,10 +266,7 @@ struct pppcp_data *lcp_new(GAtPPP *ppp)
pppcp_set_data(pppcp, lcp);
- lcp->req_options = REQ_OPTION_ACCM;
- lcp->accm = 0;
-
- lcp_generate_config_options(lcp);
+ lcp_reset_local_options(lcp);
pppcp_set_local_options(pppcp, lcp->options, lcp->options_len);
return pppcp;