shithub: plan9front

Download patch

ref: 13996f7f38601ab82bfe16c7dec0e2d618fe11b1
parent: 373daa759c0548af932a49d1806eb6c937459e02
author: cinap_lenrek <>
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

--- a/sys/src/9/ip/ip.c
+++ b/sys/src/9/ip/ip.c
@@ -136,7 +136,7 @@
 	medialen = ifc->maxtu - ifc->m->hsize;
-		tcpmssclamp((uchar*)eh, len, medialen);
+		tcpmssclamp(bp->rp, BLEN(bp), medialen);
 	else {
 		eh->vihl = IP_VER4|IP_HLEN4;
 		eh->tos = tos;