diff options
Diffstat (limited to 'source3/nmbd/asyncdns.c')
-rw-r--r-- | source3/nmbd/asyncdns.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c index 4db54ea198..c0626d1161 100644 --- a/source3/nmbd/asyncdns.c +++ b/source3/nmbd/asyncdns.c @@ -34,16 +34,18 @@ static struct name_record *add_dns_result(struct nmb_name *question, struct in_a if (!addr.s_addr) { /* add the fail to WINS cache of names. give it 1 hour in the cache */ DEBUG(3,("add_dns_result: Negative DNS answer for %s\n", qname)); - (void)add_name_to_subnet( wins_server_subnet, qname, name_type, + add_name_to_subnet( wins_server_subnet, qname, name_type, NB_ACTIVE, 60*60, DNSFAIL_NAME, 1, &addr ); - return( NULL ); + return NULL; } /* add it to our WINS cache of names. give it 2 hours in the cache */ DEBUG(3,("add_dns_result: DNS gave answer for %s of %s\n", qname, inet_ntoa(addr))); - return( add_name_to_subnet( wins_server_subnet, qname, name_type, - NB_ACTIVE, 2*60*60, DNS_NAME, 1, &addr ) ); + add_name_to_subnet( wins_server_subnet, qname, name_type, + NB_ACTIVE, 2*60*60, DNS_NAME, 1, &addr); + + return find_name_on_subnet(wins_server_subnet, question, FIND_ANY_NAME); } #ifndef SYNC_DNS @@ -283,8 +285,7 @@ void run_dns_queue(void) queue a DNS query ****************************************************************************/ -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n) +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question) { if (in_dns || fd_in == -1) return False; @@ -316,9 +317,9 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, we use this when we can't do async DNS lookups ****************************************************************************/ -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n) +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question) { + struct name_record *namerec = NULL; struct in_addr dns_ip; unstring qname; @@ -334,11 +335,12 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, /* Re-block TERM signal. */ BlockSignals(True, SIGTERM); - *n = add_dns_result(question, dns_ip); - if(*n == NULL) + namerec = add_dns_result(question, dns_ip); + if(namerec == NULL) { send_wins_name_query_response(NAM_ERR, p, NULL); - else - send_wins_name_query_response(0, p, *n); + } else { + send_wins_name_query_response(0, p, namerec); + } return False; } |