summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-06-18 14:59:36 +0000
committerbrian <brian@FreeBSD.org>2001-06-18 14:59:36 +0000
commit14263ff751db1d878bad974a406737533ea6b70c (patch)
tree5bb2d9ee08d5ff16a973109f6f61899430eeb81e /usr.sbin/ppp/bundle.c
parentfd0a00a7295105bd1c94ad22b13d090c15c702a4 (diff)
downloadFreeBSD-src-14263ff751db1d878bad974a406737533ea6b70c.zip
FreeBSD-src-14263ff751db1d878bad974a406737533ea6b70c.tar.gz
Handle hardware-imposed MTU/MRU limitations. PPPoE will no longer
allow MRU/MTU negotiations to exceed 1492. Add an optional ``max'' specifier to ``set m[rt]u'', ie. set mtu max 1480 Bump the ppp version number. Sponsored by: Monzoon Networks AG and FreeBSD Services Limited
Diffstat (limited to 'usr.sbin/ppp/bundle.c')
-rw-r--r--usr.sbin/ppp/bundle.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index f8d8ad6..7e48499 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -802,7 +802,6 @@ bundle_Create(const char *prefix, int type, int unit)
log_Printf(LogPHASE, "Using interface: %s\n", ifname);
bundle.bandwidth = 0;
- bundle.mtu = 1500;
bundle.routing_seq = 0;
bundle.phase = PHASE_DEAD;
bundle.CleaningUp = 0;
@@ -821,7 +820,6 @@ bundle_Create(const char *prefix, int type, int unit)
bundle.cfg.opt = OPT_SROUTES | OPT_IDCHECK | OPT_LOOPBACK | OPT_TCPMSSFIXUP |
OPT_THROUGHPUT | OPT_UTMP;
*bundle.cfg.label = '\0';
- bundle.cfg.mtu = DEF_MTU;
bundle.cfg.ifqueue = DEF_IFQUEUE;
bundle.cfg.choked.timeout = CHOKED_TIMEOUT;
bundle.phys_type.all = type;
@@ -1096,11 +1094,6 @@ bundle_ShowStatus(struct cmdargs const *arg)
prompt_Printf(arg->prompt, "\n");
} else
prompt_Printf(arg->prompt, "disabled\n");
- prompt_Printf(arg->prompt, " MTU: ");
- if (arg->bundle->cfg.mtu)
- prompt_Printf(arg->prompt, "%d\n", arg->bundle->cfg.mtu);
- else
- prompt_Printf(arg->prompt, "unspecified\n");
prompt_Printf(arg->prompt, " sendpipe: ");
if (arg->bundle->ncp.ipcp.cfg.sendpipe > 0)
@@ -1826,7 +1819,7 @@ bundle_CalculateBandwidth(struct bundle *bundle)
int sp;
bundle->bandwidth = 0;
- bundle->mtu = 0;
+ bundle->iface->mtu = 0;
for (dl = bundle->links; dl; dl = dl->next)
if (dl->state == DATALINK_OPEN) {
if ((sp = dl->mp.bandwidth) == 0 &&
@@ -1836,7 +1829,7 @@ bundle_CalculateBandwidth(struct bundle *bundle)
else
bundle->bandwidth += sp;
if (!bundle->ncp.mp.active) {
- bundle->mtu = dl->physical->link.lcp.his_mru;
+ bundle->iface->mtu = dl->physical->link.lcp.his_mru;
break;
}
}
@@ -1845,16 +1838,16 @@ bundle_CalculateBandwidth(struct bundle *bundle)
bundle->bandwidth = 115200; /* Shrug */
if (bundle->ncp.mp.active)
- bundle->mtu = bundle->ncp.mp.peer_mrru;
- else if (!bundle->mtu)
- bundle->mtu = 1500;
+ bundle->iface->mtu = bundle->ncp.mp.peer_mrru;
+ else if (!bundle->iface->mtu)
+ bundle->iface->mtu = DEF_MRU;
#ifndef NORADIUS
if (bundle->radius.valid && bundle->radius.mtu &&
- bundle->radius.mtu < bundle->mtu) {
+ bundle->radius.mtu < bundle->iface->mtu) {
log_Printf(LogLCP, "Reducing MTU to radius value %lu\n",
bundle->radius.mtu);
- bundle->mtu = bundle->radius.mtu;
+ bundle->iface->mtu = bundle->radius.mtu;
}
#endif
OpenPOWER on IntegriCloud