projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import new (much simpler) resolver code from Hybrid.
[ircu2.10.12-pk.git]
/
ircd
/
s_bsd.c
diff --git
a/ircd/s_bsd.c
b/ircd/s_bsd.c
index 27d66901f0418abc6de1a29c78445a1bcca98b61..0d460ba8e5fd4451cd01101cdcd69ae7891c9228 100644
(file)
--- a/
ircd/s_bsd.c
+++ b/
ircd/s_bsd.c
@@
-58,12
+58,10
@@
#include "version.h"
#include <arpa/inet.h>
#include "version.h"
#include <arpa/inet.h>
-#include <arpa/nameser.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
-#include <resolv.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-177,13
+175,14
@@
void report_error(const char* text, const char* who, int err)
* a non-null pointer, otherwise reply will be null.
* if successful start the connection, otherwise notify opers
*/
* a non-null pointer, otherwise reply will be null.
* if successful start the connection, otherwise notify opers
*/
-static void connect_dns_callback(void* vptr, struct
hostent
* hp)
+static void connect_dns_callback(void* vptr, struct
DNSReply
* hp)
{
struct ConfItem* aconf = (struct ConfItem*) vptr;
assert(aconf);
aconf->dns_pending = 0;
if (hp) {
{
struct ConfItem* aconf = (struct ConfItem*) vptr;
assert(aconf);
aconf->dns_pending = 0;
if (hp) {
- memcpy(&aconf->ipnum, hp->h_addr, sizeof(struct in_addr));
+ struct sockaddr_in *sin = (struct sockaddr_in*)&hp->addr;
+ memcpy(&aconf->ipnum, &sin->sin_addr, sizeof(struct in_addr));
MyFree(hp);
connect_server(aconf, 0);
}
MyFree(hp);
connect_server(aconf, 0);
}
@@
-396,6
+395,7
@@
void release_dns_reply(struct Client* cptr)
assert(MyConnect(cptr));
if (cli_dns_reply(cptr)) {
assert(MyConnect(cptr));
if (cli_dns_reply(cptr)) {
+ MyFree(cli_dns_reply(cptr)->h_name);
MyFree(cli_dns_reply(cptr));
cli_dns_reply(cptr) = 0;
}
MyFree(cli_dns_reply(cptr));
cli_dns_reply(cptr) = 0;
}