summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-04-10 10:56:08 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-04-10 10:56:08 +0300
commitfc098b3062badfd802f91241533069cad4886b6f (patch)
treea973fa494e6dde3945710b394044d4b33095495e /accel-pppd/ppp
parent950c13a76e76438d6dd40a8e716ad351e546ed46 (diff)
downloadaccel-ppp-fc098b3062badfd802f91241533069cad4886b6f.tar.gz
accel-ppp-fc098b3062badfd802f91241533069cad4886b6f.zip
pppoe: do not negotiate LCP MRU option if it is larger than 1492
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r--accel-pppd/ppp/lcp_opt_mru.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/accel-pppd/ppp/lcp_opt_mru.c b/accel-pppd/ppp/lcp_opt_mru.c
index 5f19bb2..56c8b6c 100644
--- a/accel-pppd/ppp/lcp_opt_mru.c
+++ b/accel-pppd/ppp/lcp_opt_mru.c
@@ -54,12 +54,21 @@ static struct lcp_option_t *mru_init(struct ppp_lcp_t *lcp)
struct mru_option_t *mru_opt = _malloc(sizeof(*mru_opt));
memset(mru_opt, 0, sizeof(*mru_opt));
- mru_opt->mru = (conf_mru && conf_mru <= lcp->ppp->ses.ctrl->max_mtu) ? conf_mru : lcp->ppp->ses.ctrl->max_mtu;
- if (mru_opt->mru > conf_max_mtu)
- mru_opt->mru = conf_max_mtu;
- mru_opt->mtu = (conf_mtu && conf_mtu <= lcp->ppp->ses.ctrl->max_mtu) ? conf_mtu : lcp->ppp->ses.ctrl->max_mtu;
- if (mru_opt->mtu > conf_max_mtu)
- mru_opt->mtu = conf_max_mtu;
+ if (lcp->ppp->ses.ctrl->no_lcp_mru) {
+ mru_opt->mru = lcp->ppp->ses.ctrl->max_mtu;
+ mru_opt->mtu = lcp->ppp->ses.ctrl->max_mtu;
+ lcp->ppp->mru = mru_opt->mru;
+ lcp->ppp->mtu = mru_opt->mtu;
+ mru_opt->naked = 1;
+ } else {
+ mru_opt->mru = (conf_mru && conf_mru <= lcp->ppp->ses.ctrl->max_mtu) ? conf_mru : lcp->ppp->ses.ctrl->max_mtu;
+ if (mru_opt->mru > conf_max_mtu)
+ mru_opt->mru = conf_max_mtu;
+ mru_opt->mtu = (conf_mtu && conf_mtu <= lcp->ppp->ses.ctrl->max_mtu) ? conf_mtu : lcp->ppp->ses.ctrl->max_mtu;
+ if (mru_opt->mtu > conf_max_mtu)
+ mru_opt->mtu = conf_max_mtu;
+ }
+
mru_opt->opt.id = CI_MRU;
mru_opt->opt.len = 4;