summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ppp_ipcp.c
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2011-08-16 13:08:54 +0400
committerKozlov Dmitry <dima@server>2011-08-16 13:08:54 +0400
commit2f48232a6f2fcba1707aa772e571aced765aff91 (patch)
tree84762d356f02ac22500c05150ff9b67be27c9f83 /accel-pppd/ppp/ppp_ipcp.c
parentc2cd908d15d70219b7154653ab088837d4c9613a (diff)
downloadaccel-ppp-2f48232a6f2fcba1707aa772e571aced765aff91.tar.gz
accel-ppp-2f48232a6f2fcba1707aa772e571aced765aff91.zip
ppp: improved CCP/IPCP handling
Diffstat (limited to 'accel-pppd/ppp/ppp_ipcp.c')
-rw-r--r--accel-pppd/ppp/ppp_ipcp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ppp_ipcp.c b/accel-pppd/ppp/ppp_ipcp.c
index 39627026..bd9f50df 100644
--- a/accel-pppd/ppp/ppp_ipcp.c
+++ b/accel-pppd/ppp/ppp_ipcp.c
@@ -135,10 +135,8 @@ void ipcp_layer_free(struct ppp_layer_data_t *ld)
_free(ipcp);
}
-static void ipcp_layer_up(struct ppp_fsm_t *fsm)
+static void __ipcp_layer_up(struct ppp_ipcp_t *ipcp)
{
- struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
-
log_ppp_debug("ipcp_layer_started\n");
if (!ipcp->started) {
@@ -147,6 +145,14 @@ static void ipcp_layer_up(struct ppp_fsm_t *fsm)
}
}
+static void ipcp_layer_up(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+
+ if (!ipcp->delay_ack)
+ __ipcp_layer_up(ipcp);
+}
+
static void ipcp_layer_down(struct ppp_fsm_t *fsm)
{
struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
@@ -563,6 +569,7 @@ static void ipcp_recv(struct ppp_handler_t*h)
struct ipcp_hdr_t *hdr;
struct ppp_ipcp_t *ipcp = container_of(h, typeof(*ipcp), hnd);
int r;
+ int delay_ack = ipcp->delay_ack;
if (ipcp->fsm.fsm_state == FSM_Initial || ipcp->fsm.fsm_state == FSM_Closed || ipcp->ppp->terminating) {
if (conf_ppp_verbose)
@@ -593,7 +600,9 @@ static void ipcp_recv(struct ppp_handler_t*h)
ipcp_free_conf_req(ipcp);
return;
}
- if (ipcp->started) {
+ if (delay_ack && !ipcp->delay_ack)
+ __ipcp_layer_up(ipcp);
+ if (ipcp->started || delay_ack) {
if (r == IPCP_OPT_ACK)
send_conf_ack(&ipcp->fsm);
else