mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 05:26:07 +03:00
fixed #17: report RCODE error msgs
This commit is contained in:
parent
829e236cba
commit
fc3de73f85
22
src/dns.c
22
src/dns.c
@ -137,7 +137,29 @@ dns_decode(char *buf, size_t buflen, struct query *q, qr_t qr, char *packet, siz
|
|||||||
switch (qr) {
|
switch (qr) {
|
||||||
case QR_ANSWER:
|
case QR_ANSWER:
|
||||||
if(qdcount != 1 || ancount != 1) {
|
if(qdcount != 1 || ancount != 1) {
|
||||||
|
switch (header->rcode) {
|
||||||
|
case REFUSED:
|
||||||
|
warnx("Got REFUSED as reply");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NOTIMP:
|
||||||
|
warnx("Got NOTIMP as reply");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NXDOMAIN:
|
||||||
|
warnx("Got NXDOMAIN as reply");
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case SERVFAIL:
|
||||||
|
warnx("Got SERVFAIL as reply");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NOERROR:
|
||||||
|
default:
|
||||||
warnx("no query or answer in answer");
|
warnx("no query or answer in answer");
|
||||||
|
break;
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user