summaryrefslogtreecommitdiff
path: root/source/sv_main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-05-31 21:10:01 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-05-31 21:10:01 +0000
commit907c3b16e8c65ea7c7cb4a0186a80f6f258ac4e0 (patch)
treeee1d79cd0ee85db048f2816ae0d3a194d1497467 /source/sv_main.c
parentaae91e293989bc6321e3a262e8c7c4c9babed447 (diff)
Do not retry sendto() if destination address is found in the error queue to prevent looping.
Experimental support for path MTU discovery enabled by setting ‘net_ignore_icmp’ to negative value. Moved net_from into net_common.c from net_chan.c
Diffstat (limited to 'source/sv_main.c')
-rw-r--r--source/sv_main.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/sv_main.c b/source/sv_main.c
index cf1efea..e63d2cc 100644
--- a/source/sv_main.c
+++ b/source/sv_main.c
@@ -1258,7 +1258,7 @@ static void SV_PacketEvent( void ) {
SV_ErrorEvent
=================
*/
-void SV_ErrorEvent( void ) {
+void SV_ErrorEvent( int info ) {
client_t *client;
netchan_t *netchan;
@@ -1278,6 +1278,20 @@ void SV_ErrorEvent( void ) {
if( net_from.port && netchan->remote_address.port != net_from.port ) {
continue;
}
+#if USE_PMTUDISC
+ if( info ) {
+ // we are doing path MTU discovery and got ICMP fragmentation-needed
+ // update MTU only for connecting clients to minimize spoofed ICMP interference
+ // MTU info has already been sanity checked for us by network code
+ // assume total 64 bytes of headers
+ if( client->state == cs_primed && info < netchan->maxpacketlen + 64 ) {
+ Com_Printf( "Fixing up maxmsglen for %s: %d --> %d\n",
+ client->name, (int)netchan->maxpacketlen, info - 64 );
+ netchan->maxpacketlen = info - 64;
+ }
+ continue;
+ }
+#endif
client->flags |= CF_ERROR; // drop them soon
break;
}