shithub: riscv

Download patch

ref: 278caaf11931ec0c71fc13fd4c4794fae325c404
parent: a65ab6daec833827ff991cbc1eee2a70fa3e4efb
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;