diff options
| author | Sam Varshavchik | 2020-05-08 23:48:19 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2020-05-08 23:48:19 -0400 | 
| commit | e8f1e9e157cbd01be78caaad7fe5be7952ec7b36 (patch) | |
| tree | 663a7980f6a2b4ac0dedcec7e96f6caf9a53a77d | |
| parent | ea9926077fe773102808184ed54a7b0327bcc237 (diff) | |
| download | courier-libs-e8f1e9e157cbd01be78caaad7fe5be7952ec7b36.tar.bz2 | |
Restart query from the original hostname.
| -rw-r--r-- | rfc1035/rfc1035search.c | 15 | 
1 files changed, 7 insertions, 8 deletions
| diff --git a/rfc1035/rfc1035search.c b/rfc1035/rfc1035search.c index 4a484c1..01d0025 100644 --- a/rfc1035/rfc1035search.c +++ b/rfc1035/rfc1035search.c @@ -227,7 +227,8 @@ int rfc1035_resolve_cname_multiple(struct rfc1035_res *res,  	struct rfc1035_query qu[nqueries];  	struct rfc1035_reply *p; -	char	cmpname1[RFC1035_MAXNAMESIZE+1], +	char	savename[RFC1035_MAXNAMESIZE+1], +		cmpname1[RFC1035_MAXNAMESIZE+1],  		cmpname2[RFC1035_MAXNAMESIZE+1];  	static const char forbidden[] = @@ -243,6 +244,7 @@ int rfc1035_resolve_cname_multiple(struct rfc1035_res *res,  	if (nqueries == 0)  		return -1; +	strcpy(savename, namebuf);  	for (u=0; u<nqueries; ++u)  	{  		qu[u].name=namebuf; @@ -316,7 +318,11 @@ int rfc1035_resolve_cname_multiple(struct rfc1035_res *res,  			if (query_again)  			{  				if (--retry_count > 0) +				{ +				  /* Query back from the original alias. */ +					strcpy(namebuf, savename);  					break; +				}  				fatal=RFC1035_ERR_CNAME_RECURSIVE;  			} @@ -343,12 +349,5 @@ int rfc1035_resolve_cname_multiple(struct rfc1035_res *res,  			if (p->rcode == RFC1035_RCODE_NOERROR)  				rfc1035_rr_rand(p); -/* -*	Collecting allrrs shall be a further proposal. -	if ((x_flags & RFC1035_X_COLLECT) && -	    (*ptr)->rcode == RFC1035_RCODE_NOERROR) -		rfc1035_collect_allrrs(*ptr); -*/ -  	return (0);  } | 
