summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 17:09:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 17:09:40 +0000
commit9604ff62cd2f5802ef571ca9286543b70c556e52 (patch)
tree2ad40119cff9b15dc3c9a4d6c7e7d9370527a7d2
parenta5c99b8dc6164ca3a9abed1c843627c1e817caaa (diff)
More tidyups
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4641 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/dns.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 69df48cc6..e2eca777c 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -314,15 +314,13 @@ int dns_build_query_payload(const char * const name, const unsigned short rr, co
int DNS::dns_getip4(const char *name)
{
- /* build, add and send A query; retrieve result with dns_getresult() */
s_header h;
- s_connection* req;
int id;
int length = dns_build_query_payload(name,DNS_QRY_A,1,(unsigned char*)&h.payload);
if (length == -1)
return -1;
- req = dns_add_query(&h, id);
+ s_connection* req = dns_add_query(&h, id);
if (req == NULL)
return -1;
@@ -333,25 +331,22 @@ int DNS::dns_getip4(const char *name)
}
int DNS::dns_getname4(const insp_inaddr *ip)
-{ /* build, add and send PTR query; retrieve result with dns_getresult() */
+{
#ifdef IPV6
return -1;
#else
- log(DEBUG,"DNS::dns_getname4");
- char query[512];
+ char query[29];
s_header h;
- s_connection* req;
- unsigned char *c;
int id;
- c = (unsigned char *)&ip->s_addr;
+ unsigned char* c = (unsigned char*)&ip->s_addr;
sprintf(query,"%d.%d.%d.%d.in-addr.arpa",c[3],c[2],c[1],c[0]);
int length = dns_build_query_payload(query,DNS_QRY_PTR,1,(unsigned char*)&h.payload);
if (length == -1)
return -1;
- req = dns_add_query(&h, id);
+ s_connection* req = dns_add_query(&h, id);
if (req == NULL)
return -1;
if (req->send_requests(&h,length,DNS_QRY_PTR) == -1)