commit - b4d406b781710c8a6983c0ac1fe99aa409fe9dc3
commit + a7c0bddd4e5283139a6d9bef6012a2f8b046071b
blob - d50a8312919dc6bff4eef9f6e32e08765e47c408
blob + 8d3bf7b6ac683f471c25126aff1db7d493dd0fc6
--- src/libndb/sysdnsquery.c
+++ src/libndb/sysdnsquery.c
{
int n, nstype;
uchar *buf, *p;
- HEADER *h;
Ndbtuple *t;
+ int qdcount, ancount;
if((nstype = name2type(type)) < 0){
werrstr("unknown dns type %s", type);
werrstr("too much dns information");
return nil;
}
-
- h = (HEADER*)buf;
- h->qdcount = ntohs(h->qdcount);
- h->ancount = ntohs(h->ancount);
- h->nscount = ntohs(h->nscount);
- h->arcount = ntohs(h->arcount);
+
+ qdcount = (buf[4]<<8)|buf[5];
+ ancount = (buf[6]<<8)|buf[7];
- p = buf+sizeof(HEADER);
- p = skipquestion(buf, buf+n, p, h->qdcount);
- p = unpack(buf, buf+n, p, &t, h->ancount);
+ p = buf+12;
+ p = skipquestion(buf, buf+n, p, qdcount);
+ p = unpack(buf, buf+n, p, &t, ancount);
USED(p);
return t;
}