typedef unsigned char address_t[sizeof (struct in_addr)];
+#ifdef HAVE_RES_SEARCH
static int getaddresses(struct addrinfo **result, const char *name)
{
struct addrinfo hints;
fm_freeaddrinfo(res1);
return rc;
}
+#endif
int is_host_alias(const char *name, struct query *ctl, struct addrinfo **res)
/* determine whether name is a DNS alias of the mailserver for this query */
{
+#ifdef HAVE_RES_SEARCH
struct mxentry *mxp, *mxrecords;
- struct idlist *idl;
- size_t namelen;
int e;
struct addrinfo hints, *res_st;
+#endif
+ struct idlist *idl;
+ size_t namelen;
struct hostdata *lead_server =
ctl->server.lead_server ? ctl->server.lead_server : &ctl->server;
namelen = strlen(name);
for (idl = lead_server->akalist; idl; idl = idl->next)
{
- char *ep;
+ const char *ep;
/*
* Test is >= here because str_in_list() should have caught the
*/
if (strlen(idl->id) >= namelen)
continue;
- ep = (char *)name + (namelen - strlen(idl->id));
+ ep = name + (namelen - strlen(idl->id));
/* a suffix led by . must match */
if (ep[-1] == '.' && !strcasecmp(ep, idl->id))
return(TRUE);
if (!ctl->server.dns)
return(FALSE);
#ifndef HAVE_RES_SEARCH
+ (void)res;
return(FALSE);
#else
/*