X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/11c8bf9bc50213e3774f8367ce3d5b17b2f95c49..680d2a652d5185d75c206444e9e8db9b82b3121c:/src/reply.c?ds=sidebyside diff --git a/src/reply.c b/src/reply.c index 2317954..f98540c 100644 --- a/src/reply.c +++ b/src/reply.c @@ -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); @@ -56,8 +57,11 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, flg_rd= f1&0x01; flg_ra= f2&0x80; rcode= (f1&0x0f); + /* fixme: change this to f2 (which is where rcode really is), BUT + * not until we've figured out why the error code is wrong (bad format code 203) + */ - if (flg_qr) { + if (!flg_qr) { adns__diag(ads,serv,0,"server sent us a query, not a response"); return; }