summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-12-04 19:49:53 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-12-04 19:49:53 +0000
commit93e31d4baeec97b7f3471c6cd854353c09082488 (patch)
treed3063b166d2395d01fd26c1db512259b846f37fa /sys
parent56b1927a40f9c8d7f4c40df6fafe78a2aab354bc (diff)
1500 is a 'magic number' in the protocol that all implementations
must be able to handle as MRU but while testing pppoe(4) against a pppoe(8) server I figured out that pppoe(8) insists on a MRU 1492. Because of this we allow the offered MRU to be between PP_MIN_MRU and PP_MAX_MRU especially because the MRU is not used at all as long as it is smaller then PP_MAX_MRU. OK canacar@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_sppp.h5
-rw-r--r--sys/net/if_spppsubr.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/net/if_sppp.h b/sys/net/if_sppp.h
index 523da6abe6f..50128c8ac39 100644
--- a/sys/net/if_sppp.h
+++ b/sys/net/if_sppp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sppp.h,v 1.12 2007/09/05 21:01:49 canacar Exp $ */
+/* $OpenBSD: if_sppp.h,v 1.13 2007/12/04 19:49:52 claudio Exp $ */
/* $NetBSD: if_sppp.h,v 1.2.2.1 1999/04/04 06:57:39 explorer Exp $ */
/*
@@ -169,7 +169,8 @@ struct sppp {
around PPP frames (i.e. the serial
HDLC like encapsulation, RFC1662) */
-#define PP_MTU 1500 /* default/minimal MRU */
+#define PP_MIN_MRU IP_MSS /* minimal MRU */
+#define PP_MTU 1500 /* default MTU */
#define PP_MAX_MRU 2048 /* maximal MRU we want to negotiate */
/*
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 167871eccf7..8ee4b39b734 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.64 2007/11/26 09:28:33 martynas Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.65 2007/12/04 19:49:52 claudio Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -1994,7 +1994,7 @@ sppp_lcp_init(struct sppp *sp)
sp->state[IDX_LCP] = STATE_INITIAL;
sp->fail_counter[IDX_LCP] = 0;
sp->lcp.protos = 0;
- sp->lcp.mru = sp->lcp.their_mru = PP_MTU;
+ sp->lcp.mru = sp->lcp.their_mru = sp->pp_if.if_mtu;
/*
* Initialize counters and timeout values. Note that we don't
@@ -2030,7 +2030,7 @@ sppp_lcp_up(struct sppp *sp)
sp->lcp.opts = (1 << LCP_OPT_MAGIC);
sp->lcp.magic = 0;
sp->lcp.protos = 0;
- sp->lcp.mru = sp->lcp.their_mru = PP_MTU;
+ sp->lcp.mru = sp->lcp.their_mru = sp->pp_if.if_mtu;
getmicrouptime(&tv);
sp->pp_last_receive = sp->pp_last_activity = tv.tv_sec;
@@ -2453,8 +2453,10 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
u_int mru = p[2] * 256 + p[3];
if (debug)
addlog("%d ", mru);
- if (mru < PP_MTU || mru > PP_MAX_MRU)
- mru = PP_MTU;
+ if (mru < PP_MIN_MRU)
+ mru = PP_MIN_MRU;
+ if (mru > PP_MAX_MRU)
+ mru = PP_MAX_MRU;
sp->lcp.mru = mru;
sp->lcp.opts |= (1 << LCP_OPT_MRU);
}