108 |
|
static void resend_query(struct reslist *request); |
109 |
|
static int proc_answer(struct reslist *request, HEADER *header, char *, char *); |
110 |
|
static struct reslist *find_id(int id); |
111 |
– |
static struct DNSReply *make_dnsreply(struct reslist *request); |
112 |
– |
|
113 |
– |
extern struct irc_ssaddr irc_nsaddr_list[IRCD_MAXNS]; |
114 |
– |
extern int irc_nscount; |
115 |
– |
extern char irc_domain[HOSTLEN+1]; |
111 |
|
|
112 |
|
|
113 |
|
/* |
268 |
|
} |
269 |
|
|
270 |
|
/* |
276 |
– |
* add_local_domain - Add the domain to hostname, if it is missing |
277 |
– |
* (as suggested by eps@TOASTER.SFSU.EDU) |
278 |
– |
*/ |
279 |
– |
void |
280 |
– |
add_local_domain(char *hname, size_t size) |
281 |
– |
{ |
282 |
– |
/* try to fix up unqualified names |
283 |
– |
*/ |
284 |
– |
if (strchr(hname, '.') == NULL) |
285 |
– |
{ |
286 |
– |
if (irc_domain[0]) |
287 |
– |
{ |
288 |
– |
size_t len = strlen(hname); |
289 |
– |
|
290 |
– |
if ((strlen(irc_domain) + len + 2) < size) |
291 |
– |
{ |
292 |
– |
hname[len++] = '.'; |
293 |
– |
strcpy(hname + len, irc_domain); |
294 |
– |
} |
295 |
– |
} |
296 |
– |
} |
297 |
– |
} |
298 |
– |
|
299 |
– |
/* |
271 |
|
* rem_request - remove a request from the list. |
272 |
|
* This must also free any memory that has been allocated for |
273 |
|
* temporary storage of DNS results. |
416 |
|
{ |
417 |
|
char host_name[HOSTLEN + 1]; |
418 |
|
|
419 |
< |
strlcpy(host_name, name, HOSTLEN + 1); |
449 |
< |
add_local_domain(host_name, HOSTLEN + 1); |
419 |
> |
strlcpy(host_name, name, sizeof(hostname)); |
420 |
|
|
421 |
|
if (request == NULL) |
422 |
|
{ |