When the peer fails to specify an MRU and a 1500 byte MRU is not
allowed either because of the transport or configuration, send a MRU NAK only once, then allow the negotiations to proceed. rfc1661 says that 1500 should always be allowed and rfc2516 says that 1492 is the maximum for PPPoE. This changes ppp so that it only weakly suggests 1492, then goes with the default (leaving the problem in the hands of the peer WRT how they set their MTU). MFC after: 1 week
This commit is contained in:
parent
33b095fe4a
commit
f8c17ff3b1
@ -297,6 +297,7 @@ lcp_Setup(struct lcp *lcp, int openmode)
|
||||
lcp->his_authtype = 0;
|
||||
lcp->his_callback.opmask = 0;
|
||||
lcp->his_shortseq = 0;
|
||||
lcp->mru_req = 0;
|
||||
|
||||
if ((lcp->want_mru = lcp->cfg.mru) == 0)
|
||||
lcp->want_mru = DEF_MRU;
|
||||
@ -554,6 +555,7 @@ LcpLayerStart(struct fsm *fp)
|
||||
log_Printf(LogLCP, "%s: LayerStart\n", fp->link->name);
|
||||
lcp->LcpFailedMagic = 0;
|
||||
fp->more.reqs = fp->more.naks = fp->more.rejs = lcp->cfg.fsm.maxreq * 3;
|
||||
lcp->mru_req = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -618,7 +620,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
{
|
||||
/* Deal with incoming PROTO_LCP */
|
||||
struct lcp *lcp = fsm2lcp(fp);
|
||||
int type, length, sz, pos, op, callback_req, mru_req;
|
||||
int type, length, sz, pos, op, callback_req;
|
||||
u_int32_t magic, accmap;
|
||||
u_short mru, phmtu, maxmtu, maxmru, wantmtu, wantmru, proto;
|
||||
struct lqrreq *req;
|
||||
@ -626,7 +628,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
struct mp *mp;
|
||||
struct physical *p = link2physical(fp->link);
|
||||
|
||||
sz = op = callback_req = mru_req = 0;
|
||||
sz = op = callback_req = 0;
|
||||
|
||||
while (plen >= sizeof(struct fsmconfig)) {
|
||||
type = *cp;
|
||||
@ -696,7 +698,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
break;
|
||||
|
||||
case TY_MRU:
|
||||
mru_req = 1;
|
||||
lcp->mru_req = 1;
|
||||
ua_ntohs(cp + 2, &mru);
|
||||
log_Printf(LogLCP, "%s %d\n", request, mru);
|
||||
|
||||
@ -1274,7 +1276,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
dec->nakend[-1] = 2; /* XXX: Silly ! */
|
||||
}
|
||||
}
|
||||
if (mode_type == MODE_REQ && !mru_req) {
|
||||
if (mode_type == MODE_REQ && !lcp->mru_req) {
|
||||
mru = DEF_MRU;
|
||||
phmtu = p ? physical_DeviceMTU(p) : 0;
|
||||
if (phmtu && mru > phmtu)
|
||||
@ -1288,6 +1290,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
*dec->nakend++ = 4;
|
||||
ua_htons(&lcp->his_mru, dec->nakend);
|
||||
dec->nakend += 2;
|
||||
lcp->mru_req = 1; /* Don't keep NAK'ing this */
|
||||
}
|
||||
}
|
||||
if (dec->rejend != dec->rej) {
|
||||
|
@ -59,6 +59,7 @@ struct lcp {
|
||||
unsigned his_shortseq : 1; /* Peer would like only 12bit seqs (MP) */
|
||||
unsigned his_protocomp : 1; /* Does peer do Protocol field compression */
|
||||
unsigned his_acfcomp : 1; /* Does peer do addr & cntrl fld compression */
|
||||
unsigned mru_req : 1; /* Has the peer requested an MRU */
|
||||
|
||||
u_short want_mru; /* Our maximum packet size */
|
||||
u_short want_mrru; /* Our maximum reassembled packet size (MP) */
|
||||
|
Loading…
Reference in New Issue
Block a user