Jelajahi Sumber

- 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 <[email protected]> for the bug report.

Andrei Pelinescu-Onciul 18 tahun lalu
induk
melakukan
859edb6abd
2 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 1 1
      Makefile.defs
  2. 5 0
      dns_cache.c

+ 1 - 1
Makefile.defs

@@ -67,7 +67,7 @@ MAIN_NAME=ser
 VERSION = 0
 PATCHLEVEL = 10
 SUBLEVEL =   99
-EXTRAVERSION = -dev65
+EXTRAVERSION = -dev66
 
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
 			$(SUBLEVEL) )

+ 5 - 0
dns_cache.c

@@ -1381,6 +1381,11 @@ inline static struct dns_hash_entry* dns_get_related(struct dns_hash_entry* e,
 				lst_end=t->prev;
 				clist_append_sublist(l, t, lst_end, next, prev);
 			}else{
+				/* if no more recs, but we found the orig. target anyway,
+				 *  return it (e.g. recs are only CNAME x & x A 1.2.3.4 or 
+				 *  CNAME & SRV) */
+				if (t->type==type)
+					ret=t; 
 				clist_append(l, t, next, prev);
 			}
 		}