mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +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,
|
sizeof (net_message_buffer), 0, (struct sockaddr *) &from,
|
||||||
&fromlen);
|
&fromlen);
|
||||||
|
|
||||||
SockadrToNetadr (&from, &net_from);
|
|
||||||
|
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int err = WSAGetLastError ();
|
int err = WSAGetLastError ();
|
||||||
|
@ -291,6 +288,8 @@ NET_GetPacket (void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SockadrToNetadr (&from, &net_from);
|
||||||
|
|
||||||
// Check for malformed packets
|
// Check for malformed packets
|
||||||
if (ntohs (net_from.port) < 1024) {
|
if (ntohs (net_from.port) < 1024) {
|
||||||
Sys_Printf ("Warning: Packet from %s dropped: Bad port\n",
|
Sys_Printf ("Warning: Packet from %s dropped: Bad port\n",
|
||||||
|
|
Loading…
Reference in a new issue