diff options
author | Andrey Nazarov <skuller@skuller.net> | 2012-07-21 16:43:20 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2012-07-21 16:43:20 +0400 |
commit | 91f083eb214764aa9d96b9c27c02d258908c7f70 (patch) | |
tree | 83ddf341a7115804a519e4463e5e57dc132a2655 /src/net_unix.h | |
parent | 77b6fe9d77fd7f72002e53585958ba77b9b44d2b (diff) |
Protect Linux ICMP code with #if USE_ICMP.
Diffstat (limited to 'src/net_unix.h')
-rw-r--r-- | src/net_unix.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net_unix.h b/src/net_unix.h index 9d36aa8..ab5bac7 100644 --- a/src/net_unix.h +++ b/src/net_unix.h @@ -31,7 +31,7 @@ static const char *os_error_string(int err) // Linux 2.2 and higher supports this via IP_RECVERR option, see ip(7). // What about BSD? -#ifdef __linux__ +#if USE_ICMP && (defined __linux__) static qboolean check_offender(const struct sockaddr_in *from, const struct sockaddr_in *to) @@ -125,7 +125,7 @@ static ssize_t os_udp_recv(netsrc_t sock, void *data, socklen_t addrlen; ssize_t ret; -#ifdef __linux__ +#if USE_ICMP && (defined __linux__) int tries; for (tries = 0; tries < MAX_ERROR_RETRIES; tries++) { #endif @@ -145,7 +145,7 @@ static ssize_t os_udp_recv(netsrc_t sock, void *data, if (net_error == EWOULDBLOCK) return NET_AGAIN; -#ifdef __linux__ +#if USE_ICMP && (defined __linux__) // recvfrom() fails on Linux if there is an ICMP originated pending // error on socket. Suck up error queue and retry... @@ -165,7 +165,7 @@ static ssize_t os_udp_send(netsrc_t sock, const void *data, NET_NetadrToSockadr(to, &addr); -#ifdef __linux__ +#if USE_ICMP && (defined __linux__) int tries; for (tries = 0; tries < MAX_ERROR_RETRIES; tries++) { #endif @@ -180,7 +180,7 @@ static ssize_t os_udp_send(netsrc_t sock, const void *data, if (net_error == EWOULDBLOCK) return NET_AGAIN; -#ifdef __linux__ +#if USE_ICMP && (defined __linux__) // sendto() fails on Linux if there is an ICMP originated pending error // on socket. Suck up error queue and retry... // |