diff options
author | brian <brian@FreeBSD.org> | 2001-10-18 08:47:56 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-10-18 08:47:56 +0000 |
commit | f9a9a183bf50c2df5584a87f4b24dc28f6efc198 (patch) | |
tree | 8dd53dd04fff720993159850dfa792a05449813d /usr.sbin | |
parent | f8774d94900ed5cfe261b132a2fada6ceac8283b (diff) | |
download | FreeBSD-src-f9a9a183bf50c2df5584a87f4b24dc28f6efc198.zip FreeBSD-src-f9a9a183bf50c2df5584a87f4b24dc28f6efc198.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/lcp.c | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/lcp.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index 4b9dfd9..e75ee72 100644 --- a/usr.sbin/ppp/lcp.c +++ b/usr.sbin/ppp/lcp.c @@ -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 @@ reqreject: 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 @@ reqreject: *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) { diff --git a/usr.sbin/ppp/lcp.h b/usr.sbin/ppp/lcp.h index 3e0e8b2..ee931ab 100644 --- a/usr.sbin/ppp/lcp.h +++ b/usr.sbin/ppp/lcp.h @@ -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) */ |