Skip to content

Commit

Permalink
add enet_mtu_1300.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Jan 12, 2023
1 parent 00452d5 commit a6a236c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ encrypt_credentials.go
src/anticheat/*credentials*
src/anticheat/key*
dist
fly.io

Dockertrigger
!/**/.gitkeep
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ apply-patches:
$(PATCH) < patches/serverbotbalanceearly.patch
$(PATCH) < patches/filterservers.patch
$(PATCH) < patches/bans.patch
$(PATCH) < patches/enet_mtu_1300.patch
cd src && make depend

gzip-cfgs:
Expand Down
1 change: 0 additions & 1 deletion anticheat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
cd $(dirname $0) # change into script directory in case it's called from somewhere else

# SAUER_OPTIONS contains any command line options you would like to start Sauerbraten with.
#SAUER_OPTIONS="-f"
SAUER_OPTIONS="-q${HOME}/.sauerbraten"

if [ "${XDG_SESSION_TYPE}" = wayland ]
Expand Down
16 changes: 16 additions & 0 deletions patches/enet_mtu_1300.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
this patch is needed in order to run servers on fly.io. due to their anycast setup, they tunnel and encrypt the UDP traffic.
see https://fly.io/docs/app-guides/udp-and-tcp/#you-might-need-to-be-mindful-of-mtus

diff --git src/enet/include/enet/enet.h src/enet/include/enet/enet.h
index fc45cbd..2246327 100644
--- src/enet/include/enet/enet.h
+++ src/enet/include/enet/enet.h
@@ -212,7 +212,7 @@ enum
ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024,
ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024,
ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000,
- ENET_HOST_DEFAULT_MTU = 1400,
+ ENET_HOST_DEFAULT_MTU = 1300,
ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024,
ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024,

2 changes: 1 addition & 1 deletion src/enet/include/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ enum
ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024,
ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024,
ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000,
ENET_HOST_DEFAULT_MTU = 1400,
ENET_HOST_DEFAULT_MTU = 1300,
ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024,
ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024,

Expand Down

0 comments on commit a6a236c

Please sign in to comment.