summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 11:50:01 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 11:50:01 +0000
commit1d6b72a5ba80b7f56f20b67b92677ffba3994991 (patch)
treee95436fe6d69af332f46cb45170c01e60be92842 /src/socket.cpp
parent5b0b077e2a9a051b93b7837da79351ede361bcd6 (diff)
(1) remove CleanAndResolve.
(2) remove feature of being able to bind hostnames in <bind> tags (it used CleanAndResolve) :p (3) Fix the stuff in SpanningTree that used CleanAndResolve to validate connecting ip addresses - it now builds an 'allowed ip cache' on rehash/startup instead git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4637 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp41
1 files changed, 8 insertions, 33 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index ff460c473..e386e8188 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -43,51 +43,26 @@ bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port
if (*addr == '*')
*addr = 0;
-
- if (*addr && (insp_aton(addr,&addy) < 1))
- {
- /* If they gave a hostname, bind to the IP it resolves to */
- if (CleanAndResolve(resolved_addr, addr, true, 1))
- {
- insp_aton(resolved_addr,&addy);
- log(DEFAULT,"Resolved binding '%s' -> '%s'",addr,resolved_addr);
-#ifdef IPV6
- /* Todo: Deal with resolution of IPV6 */
- server.sin6_addr = addy;
-#else
- server.sin_addr = addy;
-#endif
- resolved = true;
- }
- else
- {
- log(DEFAULT,"WARNING: Could not resolve '%s' to an IP for binding to on port %d",addr,port);
- return false;
- }
- }
#ifdef IPV6
server.sin6_family = AF_FAMILY;
#else
server.sin_family = AF_FAMILY;
#endif
- if (!resolved)
+ if (!*addr)
{
- if (!*addr)
- {
#ifdef IPV6
- memcpy(&addy, &server.sin6_addr, sizeof(in6_addr));
+ memcpy(&addy, &server.sin6_addr, sizeof(in6_addr));
#else
- server.sin_addr.s_addr = htonl(INADDR_ANY);
+ server.sin_addr.s_addr = htonl(INADDR_ANY);
#endif
- }
- else
- {
+ }
+ else
+ {
#ifdef IPV6
- memcpy(&addy, &server.sin6_addr, sizeof(in6_addr));
+ memcpy(&addy, &server.sin6_addr, sizeof(in6_addr));
#else
- server.sin_addr = addy;
+ server.sin_addr = addy;
#endif
- }
}
#ifdef IPV6
server.sin6_port = htons(port);