diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-12-04 19:49:53 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-12-04 19:49:53 +0000 |
commit | 93e31d4baeec97b7f3471c6cd854353c09082488 (patch) | |
tree | d3063b166d2395d01fd26c1db512259b846f37fa /sys/net/if_spppsubr.c | |
parent | 56b1927a40f9c8d7f4c40df6fafe78a2aab354bc (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/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 12 |
1 files changed, 7 insertions, 5 deletions
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); } |