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:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user