summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/tcp.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-12-30 15:10:37 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-12-30 15:10:37 +0000
commit34a662c6af90f4bd5f2ae184aeb126342e4e799e (patch)
treef7442fcaeee44c02a553c305a0c6bfb471244d35 /sys/src/9/ip/tcp.c
parent6b5de9ee6738c0f52122978130d4a8a508d75739 (diff)
tcp: only create new translation when SYN packet
Diffstat (limited to 'sys/src/9/ip/tcp.c')
-rw-r--r--sys/src/9/ip/tcp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/9/ip/tcp.c b/sys/src/9/ip/tcp.c
index bd4616d93..5b6bda262 100644
--- a/sys/src/9/ip/tcp.c
+++ b/sys/src/9/ip/tcp.c
@@ -3292,6 +3292,10 @@ tcpforward(Proto *tcp, Block *bp, Route *r)
dp = nhgets(h4->tcpdport);
sp = nhgets(h4->tcpsport);
+ /* don't make new translation when not syn packet */
+ if((h4->tcpflag[1] & (ACK|RST|SYN|FIN)) != SYN)
+ r = nil;
+
qlock(tcp);
q = transforward(tcp, &((Tcppriv*)tcp->priv)->ht, sa, sp, da, dp, r);
if(q == nil){