summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/ip.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-09-17 13:32:58 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-09-17 13:32:58 +0000
commit5a1c1b590d319d58a178c6d299e99142bf7d4433 (patch)
tree7dd34e3085dae2fb95317c0d0c0d15081b11a03a /sys/src/9/ip/ip.h
parent05b08f6665b8b0c14c0cb4caa42929db8d26c6c9 (diff)
devip: do tcp mss clamping when forwarding packets
when forwarding packets (gating), unconditionally check tcp-syn packets for the mss-size option and reduce it to fit the mtu of the outgoing interface. this is done by exporting a new tcpmssclamp() function from ip/tcp.c that takes an ip packet and its buffer size and the effective mtu of the interface and adjusts the mss value of tcp syn options. this function is now also used by devbridge, enforcing a tcp mss below the tunnel mtu.
Diffstat (limited to 'sys/src/9/ip/ip.h')
-rw-r--r--sys/src/9/ip/ip.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/9/ip/ip.h b/sys/src/9/ip/ip.h
index ca77043cd..56d94d4cf 100644
--- a/sys/src/9/ip/ip.h
+++ b/sys/src/9/ip/ip.h
@@ -755,6 +755,11 @@ extern void ip_init(Fs*);
extern void ip_init_6(Fs*);
/*
+ * tcp.c
+ */
+extern void tcpmssclamp(uchar*, int, int);
+
+/*
* bootp.c
*/
extern int bootpread(char*, ulong, int);