From e15771f4a4d0ec88e7ec3e4b444d4a365878c43a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 23 Jul 2011 15:57:32 +0900 Subject: [PATCH] Nuke a dead function. --- include/netchan.h | 1 - libs/net/nc/net_udp.c | 32 -------------------------------- libs/net/nc/net_udp6.c | 31 ------------------------------- 3 files changed, 64 deletions(-) diff --git a/include/netchan.h b/include/netchan.h index cc756d984..2a0f3d151 100644 --- a/include/netchan.h +++ b/include/netchan.h @@ -71,7 +71,6 @@ qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b); const char *NET_AdrToString (netadr_t a); const char *NET_BaseAdrToString (netadr_t a); qboolean NET_StringToAdr (const char *s, netadr_t *a); -qboolean NET_IsClientLegal(netadr_t *adr); int Net_Log_Init (const char **sound_precache); diff --git a/libs/net/nc/net_udp.c b/libs/net/nc/net_udp.c index 1bf689885..88ecac68f 100644 --- a/libs/net/nc/net_udp.c +++ b/libs/net/nc/net_udp.c @@ -229,37 +229,6 @@ NET_StringToAdr (const char *s, netadr_t *a) return true; } -// Returns true if we can't bind the address locally--in other words, -// the IP is NOT one of our interfaces. -qboolean -NET_IsClientLegal (netadr_t *adr) -{ -#if 0 - int newsocket; - AF_address_t sadr; - - if (adr->ip[0] == 127) - return false; // no local connections period - - NetadrToSockadr (adr, &sadr); - - if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) - Sys_Error ("NET_IsClientLegal: socket:", strerror (errno)); - - sadr.sin_port = 0; - - if (bind (newsocket, (void *) &sadr, sizeof (sadr)) == -1) { - // It is not a local address - close (newsocket); - return true; - } - close (newsocket); - return false; -#else - return true; -#endif -} - qboolean NET_GetPacket (void) { @@ -422,7 +391,6 @@ NET_Init (int port) Sys_Error ("Winsock initialization failed."); #endif /* _WIN32 */ - // open the single socket to be used for all communications net_socket = UDP_OpenSocket (port); // init the message buffer diff --git a/libs/net/nc/net_udp6.c b/libs/net/nc/net_udp6.c index fc8e60541..8b261db2e 100644 --- a/libs/net/nc/net_udp6.c +++ b/libs/net/nc/net_udp6.c @@ -375,37 +375,6 @@ NET_StringToAdr (const char *s, netadr_t *a) return true; } -// Returns true if we can't bind the address locally--in other words, -// the IP is NOT one of our interfaces. -qboolean -NET_IsClientLegal (netadr_t *adr) -{ -#if 0 - int newsocket; - struct sockaddr_in sadr; - - if (adr->ip[0] == 127) - return false; // no local connections period - - NetadrToSockadr (adr, &sadr); - - if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) - Sys_Error ("NET_IsClientLegal: socket: %s", strerror (errno)); - - sadr.sin_port = 0; - - if (bind (newsocket, (void *) &sadr, sizeof (sadr)) == -1) { - // It is not a local address - close (newsocket); - return true; - } - close (newsocket); - return false; -#else - return true; -#endif -} - qboolean NET_GetPacket (void) {