Remove the IP check when processing game info or version deny as the IP might be translated (IPv6 especially)

This commit is contained in:
zicodxx 2009-11-24 12:12:15 +00:00
parent febe5d124d
commit 34019d6414
2 changed files with 2 additions and 6 deletions

View file

@ -3,6 +3,7 @@ D2X-Rebirth Changelog
20091124 20091124
-------- --------
include/args.h, INSTALL.txt, main/net_udp.c, main/net_udp.h, main/fireball.c, main/multi.c, main/multibot.c, main/multi.h, main/inferno.c, main/menu.c, main/object.c, main/kmatrix.c, main/kmatrix.h, main/newdemo.c, main/config.c, main/net_ipx.c, main/config.h, main/net_ipx.h, main/gamerend.c, main/gameseq.c, main/endlevel.c, main/vers_id.h, main/game.c, main/gauges.c, misc/args.c, SConstruct, d2x.ini, README.txt, arch/linux/ipx.c, arch/linux/ipx_kali.c, arch/win32/ipx.c: Abstracting networking protocols - Step 4: Implemented new UDP layer with Client/Server communication, Packet Loss Prevention and strict Version checking. Netgames list will follow later. include/args.h, INSTALL.txt, main/net_udp.c, main/net_udp.h, main/fireball.c, main/multi.c, main/multibot.c, main/multi.h, main/inferno.c, main/menu.c, main/object.c, main/kmatrix.c, main/kmatrix.h, main/newdemo.c, main/config.c, main/net_ipx.c, main/config.h, main/net_ipx.h, main/gamerend.c, main/gameseq.c, main/endlevel.c, main/vers_id.h, main/game.c, main/gauges.c, misc/args.c, SConstruct, d2x.ini, README.txt, arch/linux/ipx.c, arch/linux/ipx_kali.c, arch/win32/ipx.c: Abstracting networking protocols - Step 4: Implemented new UDP layer with Client/Server communication, Packet Loss Prevention and strict Version checking. Netgames list will follow later.
main/net_udp.c: Remove the IP check when processing game info or version deny as the IP might be translated (IPv6 especially)
20091117 20091117
-------- --------

View file

@ -1652,9 +1652,6 @@ void net_udp_send_version_deny(struct _sockaddr sender_addr)
void net_udp_process_version_deny(ubyte *data, struct _sockaddr sender_addr) void net_udp_process_version_deny(ubyte *data, struct _sockaddr sender_addr)
{ {
if (memcmp((struct _sockaddr *)&Netgame.players[0].protocol.udp.addr, (struct _sockaddr *)&sender_addr, sizeof(struct _sockaddr)))
return;
Netgame.protocol.udp.program_iver = GET_INTEL_INT(&data[1]); Netgame.protocol.udp.program_iver = GET_INTEL_INT(&data[1]);
Netgame.protocol.udp.valid = -1; Netgame.protocol.udp.valid = -1;
} }
@ -1946,9 +1943,7 @@ void net_udp_process_game_info(ubyte *data, int data_len, struct _sockaddr game_
if (data_len > UPKT_MAX_SIZE) if (data_len > UPKT_MAX_SIZE)
return; return;
// Check if this game info comes from the address, we've already choosen memcpy((struct _sockaddr *)&Netgame.players[0].protocol.udp.addr, (struct _sockaddr *)&game_addr, sizeof(struct _sockaddr));
if (memcmp((struct _sockaddr *)&Netgame.players[0].protocol.udp.addr, (struct _sockaddr *)&game_addr, sizeof(struct _sockaddr)))
return;
len++; // skip UPID byte len++; // skip UPID byte
Netgame.protocol.udp.program_iver = GET_INTEL_INT(&(data[len])); len += 4; Netgame.protocol.udp.program_iver = GET_INTEL_INT(&(data[len])); len += 4;