chiark / gitweb /
Bugfixes.
[adns.git] / src / reply.c
index 2317954d9ea8fd779900d59bc990a66f5da3785a..cbb66a143eb27be6045d0ea9bf704223d3aa384b 100644 (file)
@@ -41,6 +41,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
     adns__diag(ads,serv,0,"received datagram too short for message header (%d)",dglen);
     return;
   }
+  cbyte= 0;
   GET_W(cbyte,id);
   GET_B(cbyte,f1);
   GET_B(cbyte,f2);
@@ -57,7 +58,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
   flg_ra= f2&0x80;
   rcode= (f1&0x0f);
 
-  if (flg_qr) {
+  if (!flg_qr) {
     adns__diag(ads,serv,0,"server sent us a query, not a response");
     return;
   }