1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 16:03:13 +02:00

+- Made NAME_SERVER (set::dns::nameserver work). The IRCd no longer

+  uses /etc/resolv.conf as reference.
This commit is contained in:
stskeeps
2001-03-02 14:58:37 +00:00
parent 6164ba8175
commit edfd90f235
3 changed files with 21 additions and 4 deletions
+2
View File
@@ -286,3 +286,5 @@
(acptr is not cptr)
- Made set::modes-on-connect work :) (strip out MODE_X and stuff plz?)
- Moved dynconf stuff from s_svs.c to s_conf.c, on popular request
- Made NAME_SERVER (set::dns::nameserver work). The IRCd no longer
uses /etc/resolv.conf as reference.
+4 -4
View File
@@ -111,12 +111,12 @@ int op;
if (op & RES_CALLINIT)
{
ret = res_init();
if (!_res.nscount)
{
/*if (!_res.nscount)
{*/
_res.nscount = 1;
_res.nsaddr_list[0].SIN_ADDR.S_ADDR =
inet_addr("127.0.0.1");
}
inet_addr(NAME_SERVER);
/* }*/
}
if (op & RES_INITSOCK)
+15
View File
@@ -2432,6 +2432,7 @@ void validate_configuration(void)
ConfigItem_link *link_ptr;
ConfigItem t;
short hide_host = 1;
struct in_addr in;
/* Let us validate dynconf first */
if (!KLINE_ADDRESS || (*KLINE_ADDRESS == '\0'))
@@ -2456,6 +2457,20 @@ void validate_configuration(void)
iNAH = 0;
Warning("set::host-on-oper-op is invalid. Disabling by default");
}
if (!NAME_SERVER)
{
Warning("set::dns::nameserver is missing. Using 127.0.0.1 as default");
NAME_SERVER = strdup("127.0.0.1");
}
else
{
in.s_addr = inet_addr(NAME_SERVER);
if (strcmp((char *)inet_ntoa(in), NAME_SERVER))
{
Warning("set::dns::nameserver (%s) is not an valid IP. Using 127.0.0.1 as default", NAME_SERVER);
ircstrdup(NAME_SERVER, "127.0.0.1");
}
}
if (HOST_TIMEOUT < 0 || HOST_TIMEOUT > 180) {
HOST_TIMEOUT = 2;
Warning("set::dns::timeout is invalid. Using default of 2 seconds");