mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Fix the same (ancient!) bug in ipv4 code...
Don't read the address of the peer until we know we've actually read a packet.
This commit is contained in:
parent
e6b75600e8
commit
999252c07a
1 changed files with 2 additions and 3 deletions
|
@ -262,9 +262,6 @@ NET_GetPacket (void)
|
|||
sizeof (net_message_buffer), 0, (struct sockaddr *) &from,
|
||||
&fromlen);
|
||||
|
||||
SockadrToNetadr (&from, &net_from);
|
||||
|
||||
|
||||
if (ret == -1) {
|
||||
#ifdef _WIN32
|
||||
int err = WSAGetLastError ();
|
||||
|
@ -291,6 +288,8 @@ NET_GetPacket (void)
|
|||
return false;
|
||||
}
|
||||
|
||||
SockadrToNetadr (&from, &net_from);
|
||||
|
||||
// Check for malformed packets
|
||||
if (ntohs (net_from.port) < 1024) {
|
||||
Sys_Printf ("Warning: Packet from %s dropped: Bad port\n",
|
||||
|
|
Loading…
Reference in a new issue