import of dnsmasq-2.37.tar.gz

This commit is contained in:
Simon Kelley
2007-02-05 14:57:57 +00:00
parent 832af0bafb
commit 1b7ecd111d
25 changed files with 2013 additions and 1640 deletions

View File

@@ -419,19 +419,24 @@ unsigned char *find_pseudoheader(HEADER *header, size_t plen, size_t *len, unsi
unsigned char *ansp = (unsigned char *)(header+1);
unsigned short rdlen, type, class;
unsigned char *ret = NULL;
if (is_sign && header->opcode == QUERY)
if (is_sign)
{
for (i = 0; i < ntohs(header->qdcount); i++)
*is_sign = 0;
if (header->opcode == QUERY)
{
if (!(ansp = skip_name(ansp, header, plen)))
return NULL;
GETSHORT(type, ansp);
GETSHORT(class, ansp);
if (class == C_IN && type == T_TKEY)
*is_sign = 1;
for (i = 0; i < ntohs(header->qdcount); i++)
{
if (!(ansp = skip_name(ansp, header, plen)))
return NULL;
GETSHORT(type, ansp);
GETSHORT(class, ansp);
if (class == C_IN && type == T_TKEY)
*is_sign = 1;
}
}
}
else