shithub: riscv

Download patch

ref: 46926aa50246c1b68ac685ae8cb396de1d60e726
parent: b5737e87262b69fbfd5750a9485de9fc8b5b06dd
author: cinap_lenrek <[email protected]>
date: Tue Sep 1 21:50:55 EDT 2015

tcp: fix mtu on server sockets again (thans mycroftix)

for incoming connection, we used s->laddr to lookup the interface
for the incoming call, but this does not work when the announce
address is tcp!*!123, then s->laddr is all zeros "::". instead,
use the incoming destination address for interface mtu lookup.

thanks mycroftix for troubleshooting!

--- a/sys/src/9/ip/tcp.c
+++ b/sys/src/9/ip/tcp.c
@@ -1771,7 +1771,7 @@
 	tcb->flags |= SYNACK;
 
 	/* set desired mss and scale */
-	tcb->mss = tcpmtu(s->p, s->laddr, s->ipversion, &tcb->scale);
+	tcb->mss = tcpmtu(s->p, dst, s->ipversion, &tcb->scale);
 
 	/* our sending max segment size cannot be bigger than what he asked for */
 	if(lp->mss != 0 && lp->mss < tcb->mss)