code: plan9front

Download patch

ref: 13996f7f38601ab82bfe16c7dec0e2d618fe11b1
parent: 373daa759c0548af932a49d1806eb6c937459e02
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Sep 18 09:31:56 EDT 2022

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.

--- a/sys/src/9/ip/ip.c
+++ b/sys/src/9/ip/ip.c
@@ -136,7 +136,7 @@
 
 	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;