*/
/* Original copyright ISC as above.
- * Code modified specifically for ircd use from the following orginal files
+ * Code modified specifically for ircd use from the following original files
* in bind ...
*
* res_comp.c
/** Array of nameserver addresses. */
struct irc_sockaddr irc_nsaddr_list[IRCD_MAXNS];
/** Number of nameservers in #irc_nsaddr_list. */
-int irc_nscount = 0;
+int irc_nscount;
/** Local domain to use as a search suffix. */
char irc_domain[HOSTLEN + 1];
};
static int parse_resvconf(void);
-static void add_nameserver(char *arg);
/** Array of decimal digits, indexed by value. */
static const char digits[] = "0123456789";
int
irc_res_init(void)
{
- irc_nscount = 0;
- return(parse_resvconf());
+ return (irc_nscount == 0) ? parse_resvconf() : 0;
}
/** Read resolver configuration file for domain and nameserver lines.
continue;
p = input;
- /* skip until something thats not a space is seen */
+ /* skip until something that's not a space is seen */
while (IsSpace(*p))
p++;
/* if at this point, have a '\0' then continue */
/** Add a resolver to #irc_nsaddr_list.
* @param[in] arg Dotted quad or IPv6 text form of nameserver address.
*/
-static void
-add_nameserver(char *arg)
+void
+add_nameserver(const char *arg)
{
struct irc_sockaddr res;
/* Done max number of nameservers? */
- if ((irc_nscount + 1) >= IRCD_MAXNS)
+ if (irc_nscount >= IRCD_MAXNS)
return;
/* Failure converting from numeric string? */
/**
* Expand compressed domain name to full domain name.
* Like irc_ns_name_uncompress(), but checks for a well-formed result.
- * @param[in] msg Pointer to the begining of the message.
+ * @param[in] msg Pointer to the beginning of the message.
* @param[in] eom First location after the message.
* @param[in] src Pointer to where to starting decoding.
* @param[out] dst Output buffer.
/**
* Expand compressed domain name to full domain name.
- * @param[in] msg Pointer to the begining of the message.
+ * @param[in] msg Pointer to the beginning of the message.
* @param[in] eom First location after the message.
* @param[in] src Pointer to where to starting decoding.
* @param[out] dst Output buffer.
/**
* Unpack compressed domain name to uncompressed form.
- * @param[in] msg Pointer to the begining of the message.
+ * @param[in] msg Pointer to the beginning of the message.
* @param[in] eom First location after the message.
* @param[in] src Pointer to where to starting decoding.
* @param[out] dst Output buffer.
return((bitlen + 7 ) / 8 + 1);
}
- return(-1); /* unknwon ELT */
+ return(-1); /* unknown ELT */
}
return(l);
if (beg_blen == NULL) {
if (c == '0') {
- /* blen never begings with 0 */
+ /* blen never begins with 0 */
return(EINVAL);
}
beg_blen = cp;