summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-07-03 22:20:19 +0000
committerbrian <brian@FreeBSD.org>2001-07-03 22:20:19 +0000
commit0deba2c342284728c367d996a120510bed8a07a4 (patch)
tree753c521335e8c5586213ea14afc2e9e2080bf808 /usr.sbin/ppp/mp.c
parentc6b698395d9dda67bfd2f061db42b9e6038c790b (diff)
downloadFreeBSD-src-0deba2c342284728c367d996a120510bed8a07a4.zip
FreeBSD-src-0deba2c342284728c367d996a120510bed8a07a4.tar.gz
Reduce the interface MTU by 2 when MPPE has been successfully negotiated.
This is necessary because MPPE will combine the protocol id with the payload received on the tun interface, encrypt it, then prepend its own protocol id, effectively increasing the payload by two bytes.
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index 2652d46..448b9e2 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -167,6 +167,8 @@ static void
mp_LayerUp(void *v, struct fsm *fp)
{
/* The given fsm (ccp) is now up */
+
+ bundle_CalculateBandwidth(fp->bundle); /* Against ccp_MTUOverhead */
}
static void
@@ -646,6 +648,11 @@ mp_Output(struct mp *mp, struct bundle *bundle, struct link *l,
mp->out.seq, m_length(m), l->name);
mp->out.seq = inc_seq(mp->peer_is12bit, mp->out.seq);
+ if (l->ccp.fsm.state != ST_OPENED && ccp_Required(&l->ccp)) {
+ log_Printf(LogPHASE, "%s: Not transmitting... waiting for CCP\n", l->name);
+ return;
+ }
+
link_PushPacket(l, m, bundle, LINK_QUEUES(l) - 1, PROTO_MP);
}
OpenPOWER on IntegriCloud