PPP: remove PPP_PHASE_MASTER conditions if multilink mode is disabled

PPP_PHASE_MASTER state is only used if multilink mode is enabled. Since
we don't support multilink mode checking for this state only add some
code for no value added at all.

Build-out PPP_PHASE_MASTER state check if multilink mode is disabled.
This commit is contained in:
Sylvain Rochet 2016-08-07 20:50:08 +02:00
parent dd0779c204
commit 5811948b0a
2 changed files with 15 additions and 3 deletions

View File

@ -618,7 +618,11 @@ void start_link(unit)
* physical layer down.
*/
void link_terminated(ppp_pcb *pcb) {
if (pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_MASTER)
if (pcb->phase == PPP_PHASE_DEAD
#ifdef HAVE_MULTILINK
|| pcb->phase == PPP_PHASE_MASTER
#endif /* HAVE_MULTILINK */
)
return;
new_phase(pcb, PPP_PHASE_DISCONNECT);
@ -698,7 +702,11 @@ void link_down(ppp_pcb *pcb) {
if (!doing_multilink) {
upper_layers_down(pcb);
if (pcb->phase != PPP_PHASE_DEAD && pcb->phase != PPP_PHASE_MASTER)
if (pcb->phase != PPP_PHASE_DEAD
#ifdef HAVE_MULTILINK
&& pcb->phase != PPP_PHASE_MASTER
#endif /* HAVE_MULTILINK */
)
new_phase(pcb, PPP_PHASE_ESTABLISH);
}
/* XXX if doing_multilink, should do something to stop

View File

@ -423,7 +423,11 @@ void lcp_close(ppp_pcb *pcb, const char *reason) {
fsm *f = &pcb->lcp_fsm;
int oldstate;
if (pcb->phase != PPP_PHASE_DEAD && pcb->phase != PPP_PHASE_MASTER)
if (pcb->phase != PPP_PHASE_DEAD
#ifdef HAVE_MULTILINK
&& pcb->phase != PPP_PHASE_MASTER
#endif /* HAVE_MULTILINK */
)
new_phase(pcb, PPP_PHASE_TERMINATE);
if (f->flags & DELAYED_UP) {