summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-09-29 19:40:16 +0000
committerbrian <brian@FreeBSD.org>1997-09-29 19:40:16 +0000
commit4ab28dc74b09d4df0bea68dc42a4b757e9ed2ca2 (patch)
tree965f536b01bbd5e9549d1510144587435db659b5 /usr.sbin/ppp/lcp.c
parent8ee659dd96d873b5cbd19e4345cf0eb021efe021 (diff)
downloadFreeBSD-src-4ab28dc74b09d4df0bea68dc42a4b757e9ed2ca2.zip
FreeBSD-src-4ab28dc74b09d4df0bea68dc42a4b757e9ed2ca2.tar.gz
If "set mtu" is used, *and* the mtu is less than the
value requested by the peer, NAK using this value rather than silently just changing the interface mtu.
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r--usr.sbin/ppp/lcp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 4c04eaa..d72679d 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -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.35 1997/09/25 00:52:34 brian Exp $
+ * $Id: lcp.c,v 1.36 1997/09/27 19:41:40 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -417,7 +417,7 @@ static void
LcpDecodeConfig(u_char * cp, int plen, int mode)
{
char *request;
- int type, length, mru;
+ int type, length, mru, mtu;
u_long *lp, magic, accmap;
u_short *sp, proto;
struct lqrreq *req;
@@ -442,8 +442,11 @@ LcpDecodeConfig(u_char * cp, int plen, int mode)
switch (mode) {
case MODE_REQ:
- if (mru > MAX_MRU) {
- *sp = htons(MAX_MRU);
+ mtu = VarPrefMTU;
+ if (mtu == 0)
+ mtu = MAX_MTU;
+ if (mru > mtu) {
+ *sp = htons(mtu);
bcopy(cp, nakp, 4);
nakp += 4;
} else if (mru < MIN_MRU) {
OpenPOWER on IntegriCloud