git: 9front

Download patch

ref: 3d29b3859516aab2c31bffe4b713d1ac9e2c2be1
parent: cd6a162313edc1dcf5698727fe041a47b767545a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun May 21 18:21:08 EDT 2023

ip/ppp: just use mtu requested from the peer.

the mtu negotiation seems wrong. it seems to assume
that the peer requests a mtu to us, but actually this
doesnt seem to be the case and if the peer doesnt
request it, we'd always use Defmntu of 1450, no
matter what we set on with -m option.

instead, we use the mtu specified with -m option
and always request it to the peer. if the peer requests
a different mtu we use that instead.

this at least gives some control and allows to just use
the correct mtu from pppoe (1492).

--- a/sys/src/cmd/ip/ppp/ppp.c
+++ b/sys/src/cmd/ip/ppp/ppp.c
@@ -157,7 +157,7 @@
 		}
 	}
 
-	ppp->mtu = Defmtu;
+	ppp->mtu = mtu;
 	ppp->mru = mtu;
 	ppp->framing = framing;
 	ppp->net = net;
@@ -294,7 +294,7 @@
 		ppp->period = 0;
 		p->optmask = 0xffffffff;
 		if(!server)
-			p->optmask &=  ~(Fauth|Fmtu);
+			p->optmask &=  ~Fauth;
 		ppp->rctlmap = 0;
 		ppp->ipcp->state = Sclosed;
 		ppp->ipcp->optmask = 0xffffffff;
--