mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
When negotiating ACCMAPs, sync our ACCMAP with the
peers by ORing the two together and NAKing or REQing the result rather than allowing seperate local/peer values. If the peer REJs our ACCMAP and our ACCMAP isn't 0, warn about it and ignore the rejection.
This commit is contained in:
parent
ba2e7a498e
commit
536d5b3331
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44374
1 changed files with 17 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
|||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lcp.c,v 1.68 1999/02/18 00:52:14 brian Exp $
|
||||
* $Id: lcp.c,v 1.69 1999/02/26 21:28:12 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Limit data field length by MRU
|
||||
|
@ -645,14 +645,26 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
|||
switch (mode_type) {
|
||||
case MODE_REQ:
|
||||
lcp->his_accmap = accmap;
|
||||
memcpy(dec->ackend, cp, 6);
|
||||
dec->ackend += 6;
|
||||
lcp->want_accmap |= accmap; /* restrict our requested map */
|
||||
if (lcp->want_accmap == accmap) {
|
||||
memcpy(dec->ackend, cp, 6);
|
||||
dec->ackend += 6;
|
||||
} else {
|
||||
/* NAK with what we now want */
|
||||
*dec->nakend++ = *cp;
|
||||
*dec->nakend++ = 6;
|
||||
ua_htonl(&lcp->want_accmap, dec->nakend);
|
||||
dec->nakend += 4;
|
||||
}
|
||||
break;
|
||||
case MODE_NAK:
|
||||
lcp->want_accmap = accmap;
|
||||
lcp->want_accmap |= accmap;
|
||||
break;
|
||||
case MODE_REJ:
|
||||
lcp->his_reject |= (1 << type);
|
||||
if (lcp->want_accmap)
|
||||
log_Printf(LogWARN, "Peer is rejecting our ACCMAP.... bad news !\n");
|
||||
else
|
||||
lcp->his_reject |= (1 << type);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue