Commit 91c672a7 authored by Aurelio Colosimo's avatar Aurelio Colosimo

st_com_execute_slave check DELAYREQ and PDELAYREQ only in slave state

parent 1f3ec181
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <pptp/diag.h> #include <pptp/diag.h>
#include "common-fun.h" #include "common-fun.h"
int st_com_execute_slave(struct pp_instance *ppi) int st_com_execute_slave(struct pp_instance *ppi, int check_delayreq)
{ {
if (pp_timer_expired(ppi->timers[PP_TIMER_ANN_RECEIPT])) { if (pp_timer_expired(ppi->timers[PP_TIMER_ANN_RECEIPT])) {
PP_VPRINTF("event ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES\n"); PP_VPRINTF("event ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES\n");
...@@ -23,6 +23,9 @@ int st_com_execute_slave(struct pp_instance *ppi) ...@@ -23,6 +23,9 @@ int st_com_execute_slave(struct pp_instance *ppi)
} }
} }
if (!check_delayreq)
return 0;
if (OPTS(ppi)->e2e_mode) { if (OPTS(ppi)->e2e_mode) {
if (pp_timer_expired(ppi->timers[PP_TIMER_DELAYREQ])) { if (pp_timer_expired(ppi->timers[PP_TIMER_DELAYREQ])) {
PP_VPRINTF("event DELAYREQ_INTERVAL_TIMEOUT_EXPIRES\n"); PP_VPRINTF("event DELAYREQ_INTERVAL_TIMEOUT_EXPIRES\n");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/* Contains all functions common to more than one state */ /* Contains all functions common to more than one state */
/* returns -1 in case of error, see below */ /* returns -1 in case of error, see below */
int st_com_execute_slave(struct pp_instance *ppi); int st_com_execute_slave(struct pp_instance *ppi, int check_delayreq);
void st_com_restart_annrec_timer(struct pp_instance *ppi); void st_com_restart_annrec_timer(struct pp_instance *ppi);
......
...@@ -37,7 +37,7 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -37,7 +37,7 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
no_incoming_msg: no_incoming_msg:
if (e == 0) if (e == 0)
e = st_com_execute_slave(ppi); e = st_com_execute_slave(ppi, 0);
if (e != 0) if (e != 0)
ppi->next_state = PPS_FAULTY; ppi->next_state = PPS_FAULTY;
......
...@@ -45,7 +45,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -45,7 +45,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
no_incoming_msg: no_incoming_msg:
if (e == 0) if (e == 0)
e = st_com_execute_slave(ppi); e = st_com_execute_slave(ppi, 0);
if (e != 0) if (e != 0)
ppi->next_state = PPS_FAULTY; ppi->next_state = PPS_FAULTY;
......
...@@ -243,7 +243,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -243,7 +243,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
no_incoming_msg: no_incoming_msg:
if (e == 0) if (e == 0)
e = st_com_execute_slave(ppi); e = st_com_execute_slave(ppi, 1);
if (e != 0) if (e != 0)
ppi->next_state = PPS_FAULTY; ppi->next_state = PPS_FAULTY;
......
...@@ -34,7 +34,7 @@ int pp_uncalibrated(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -34,7 +34,7 @@ int pp_uncalibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
no_incoming_msg: no_incoming_msg:
if (e == 0) if (e == 0)
e = st_com_execute_slave(ppi); e = st_com_execute_slave(ppi, 0);
if (e != 0) if (e != 0)
ppi->next_state = PPS_FAULTY; ppi->next_state = PPS_FAULTY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment