From 13996f7f38601ab82bfe16c7dec0e2d618fe11b1 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 18 Sep 2022 13:31:56 +0000 Subject: tcpmssclamp: pass correct size tcpmssclamp() The len variable refers to the total length of a Block list in ipoputX(), but we need to pass the size of the buffer we pass instead, which can be less if there are multiple blocks. --- sys/src/9/ip/ip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/9/ip') diff --git a/sys/src/9/ip/ip.c b/sys/src/9/ip/ip.c index 89e6cf5a7..136ef1c66 100644 --- a/sys/src/9/ip/ip.c +++ b/sys/src/9/ip/ip.c @@ -136,7 +136,7 @@ ipoput4(Fs *f, Block *bp, int gating, int ttl, int tos, Routehint *rh) medialen = ifc->maxtu - ifc->m->hsize; if(gating) - tcpmssclamp((uchar*)eh, len, medialen); + tcpmssclamp(bp->rp, BLEN(bp), medialen); else { eh->vihl = IP_VER4|IP_HLEN4; eh->tos = tos; -- cgit v1.2.3