summaryrefslogtreecommitdiffstats
path: root/sys/net/if_spppsubr.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-12-30 17:12:28 +0000
committerjoerg <joerg@FreeBSD.org>2001-12-30 17:12:28 +0000
commit264fac8137513dc25f5e00bcab039df0fa0774f9 (patch)
tree940693702a72d967828ca212c6f004869c0425a5 /sys/net/if_spppsubr.c
parent746e1e7c09131cd6e458318d0ac57d5c309df81b (diff)
downloadFreeBSD-src-264fac8137513dc25f5e00bcab039df0fa0774f9.zip
FreeBSD-src-264fac8137513dc25f5e00bcab039df0fa0774f9.tar.gz
Fix a long-standing blatant bug where the operator precedence between
& and && has been botched. This was likely the cause for some havoc with various negotiation cases of sppp in the past. Obtained from: NetBSD (rev 1.13) MFC after: 1 week
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r--sys/net/if_spppsubr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index a018500..040a390 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -2610,7 +2610,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 */
@@ -2642,7 +2642,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);
}
@@ -2735,7 +2735,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;
}
@@ -5123,7 +5123,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 */
OpenPOWER on IntegriCloud