Browse code

- dns cache resolv fix: responses containting only a CNAME and a non-CNAME record for the CNAME target (e.g. foo CNAME bar ; bar A 1.2.3.4) w/o any additional records, were badly interpreted (the non-CNAME response was interpreted as a CNAME). Thanks to Alfred E. Heggestad <aeh@db.org> for the bug report.

Andrei Pelinescu-Onciul authored on 22/01/2007 14:05:01
Showing 2 changed files
... ...
@@ -67,7 +67,7 @@ MAIN_NAME=ser
67 67
 VERSION = 0
68 68
 PATCHLEVEL = 10
69 69
 SUBLEVEL =   99
70
-EXTRAVERSION = -dev65
70
+EXTRAVERSION = -dev66
71 71
 
72 72
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
73 73
 			$(SUBLEVEL) )
... ...
@@ -1381,6 +1381,11 @@ inline static struct dns_hash_entry* dns_get_related(struct dns_hash_entry* e,
1381 1381
 				lst_end=t->prev;
1382 1382
 				clist_append_sublist(l, t, lst_end, next, prev);
1383 1383
 			}else{
1384
+				/* if no more recs, but we found the orig. target anyway,
1385
+				 *  return it (e.g. recs are only CNAME x & x A 1.2.3.4 or 
1386
+				 *  CNAME & SRV) */
1387
+				if (t->type==type)
1388
+					ret=t; 
1384 1389
 				clist_append(l, t, next, prev);
1385 1390
 			}
1386 1391
 		}