From da2ad810d29d16446adf5b88f8371704c1c88786 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 10 Mar 2006 11:50:03 +0000 Subject: Support for hostnames in tag (so long as the hostname resolves to a locally bindable ip) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3621 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/message.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/message.cpp') diff --git a/src/message.cpp b/src/message.cpp index 29a4ae998..39c321f42 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -166,15 +166,24 @@ void NonBlocking(int s) fcntl(s, F_SETFL, flags | O_NONBLOCK); } -int CleanAndResolve (char *resolvedHost, const char *unresolvedHost) +int CleanAndResolve (char *resolvedHost, const char *unresolvedHost, bool forward) { + int fd; + std::string ipaddr; + DNS d(Config->DNSServer); - int fd = d.ReverseLookup(unresolvedHost); + if (forward) + fd = d.ForwardLookup(unresolvedHost); + else + fd = d.ReverseLookup(unresolvedHost); if (fd < 0) return 0; time_t T = time(NULL)+1; while ((!d.HasResult()) && (time(NULL)