Forward port of 2.5 patch.
/*
- * $Id: comm.cc,v 1.399 2004/12/20 16:30:35 robertc Exp $
+ * $Id: comm.cc,v 1.400 2005/02/13 15:49:50 serassio Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
S.sin_family = AF_INET;
S.sin_addr = in_addr;
S.sin_port = htons(port);
-
- if (Config.onoff.log_fqdn)
- fqdncache_gethostbyaddr(S.sin_addr, FQDN_LOOKUP_IF_MISS);
}
void
/*
- * $Id: fqdncache.cc,v 1.162 2004/12/20 16:30:35 robertc Exp $
+ * $Id: fqdncache.cc,v 1.163 2005/02/13 15:49:50 serassio Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
if (answers[k]._class != RFC1035_CLASS_IN)
continue;
- f->names[f->name_count++] = xstrndup(answers[k].rdata, answers[k].rdlength);
+ if (!answers[k].rdata[0])
+ continue;
+
+ f->names[f->name_count++] = xstrdup(answers[k].rdata);
if (ttl == 0 || (int) answers[k].ttl < ttl)
ttl = answers[k].ttl;
/*
- * $Id: ipcache.cc,v 1.249 2004/12/20 16:30:35 robertc Exp $
+ * $Id: ipcache.cc,v 1.250 2005/02/13 15:49:50 serassio Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
if (answers[k]._class != RFC1035_CLASS_IN)
continue;
+ if (answers[k].rdlength != 4) {
+ debug(14, 1)("ipcacheParse: Invalid IP address in response to '%s'\n", name);
+ continue;
+ }
+
na++;
}
if (answers[k]._class != RFC1035_CLASS_IN)
continue;
+ if (answers[k].rdlength != 4)
+ continue;
+
if (ttl == 0 || (int) answers[k].ttl < ttl)
ttl = answers[k].ttl;
- assert(answers[k].rdlength == 4);
-
xmemcpy(&i->addrs.in_addrs[j++], answers[k].rdata, 4);
debug(14, 3) ("ipcacheParse: #%d %s\n",