diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-02 11:50:01 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-02 11:50:01 +0000 |
commit | 1d6b72a5ba80b7f56f20b67b92677ffba3994991 (patch) | |
tree | e95436fe6d69af332f46cb45170c01e60be92842 /src/inspsocket.cpp | |
parent | 5b0b077e2a9a051b93b7837da79351ede361bcd6 (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/inspsocket.cpp')
-rw-r--r-- | src/inspsocket.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index f443873e5..f738835a8 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -57,9 +57,9 @@ InspSocket::InspSocket(int newfd, const char* ip) } } -InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsigned long maxtime) : fd(-1) +InspSocket::InspSocket(const std::string &ipaddr, int aport, bool listening, unsigned long maxtime) : fd(-1) { - strlcpy(host,ahost.c_str(),MAXBUF); + strlcpy(host,ipaddr.c_str(),MAXBUF); this->ClosePending = false; if (listening) { if ((this->fd = OpenTCPSocket()) == ERROR) @@ -73,7 +73,7 @@ InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsi } else { - if (!BindSocket(this->fd,this->client,this->server,aport,(char*)ahost.c_str())) + if (!BindSocket(this->fd,this->client,this->server,aport,(char*)ipaddr.c_str())) { log(DEBUG,"BindSocket() error %s",strerror(errno)); this->Close(); @@ -98,7 +98,7 @@ InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsi } else { - strlcpy(this->host,ahost.c_str(),MAXBUF); + strlcpy(this->host,ipaddr.c_str(),MAXBUF); this->port = aport; if (insp_aton(host,&addy) < 1) @@ -170,18 +170,6 @@ bool InspSocket::BindAddr() if ((IP != "*") && (IP != "127.0.0.1") && (IP != "")) { insp_sockaddr s; - char resolved_addr[MAXBUF]; - - if (insp_aton(IP.c_str(),&n) < 1) - { - /* If they gave a hostname, bind to the IP it resolves to */ - log(DEBUG,"Resolving host %s",IP.c_str()); - if (CleanAndResolve(resolved_addr, IP.c_str(), true, 1)) - { - log(DEBUG,"Resolved host %s to %s",IP.c_str(),resolved_addr); - IP = resolved_addr; - } - } if (insp_aton(IP.c_str(),&n) > 0) { |