fix operator precedence (& and &&). do not transmit too much message

from LCP layer to NCP layer.  PR 11161.
This commit is contained in:
itojun 2000-10-08 02:37:42 +00:00
parent 48cc942e89
commit 4eb5250694
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_spppsubr.c,v 1.12 2000/10/02 03:53:47 itojun Exp $ */
/* $NetBSD: if_spppsubr.c,v 1.13 2000/10/08 02:37:42 itojun Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@ -2519,7 +2519,7 @@ sppp_lcp_tlu(struct sppp *sp)
/* Send Up events to all started protos. */
for (i = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1)
if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0)
if ((sp->lcp.protos & mask) && ((cps[i])->flags & CP_LCP) == 0)
(cps[i])->Up(sp);
/* notify low-level driver of state change */
@ -2553,7 +2553,7 @@ sppp_lcp_tld(struct sppp *sp)
* describes it.
*/
for (i = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1)
if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0) {
if ((sp->lcp.protos & mask) && ((cps[i])->flags & CP_LCP) == 0) {
(cps[i])->Down(sp);
(cps[i])->Close(sp);
}
@ -2647,7 +2647,7 @@ sppp_ncp_check(struct sppp *sp)
int i, mask;
for (i = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1)
if (sp->lcp.protos & mask && (cps[i])->flags & CP_NCP)
if ((sp->lcp.protos & mask) && (cps[i])->flags & CP_NCP)
return 1;
return 0;
}
@ -5052,7 +5052,7 @@ sppp_phase_network(struct sppp *sp)
/* Send Up events to all NCPs. */
for (i = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1)
if (sp->lcp.protos & mask && ((cps[i])->flags & CP_NCP))
if ((sp->lcp.protos & mask) && ((cps[i])->flags & CP_NCP))
(cps[i])->Up(sp);
/* if no NCP is starting, all this was in vain, close down */