summaryrefslogtreecommitdiffstats
path: root/rfc1035/rfc1035reply.c
diff options
context:
space:
mode:
Diffstat (limited to 'rfc1035/rfc1035reply.c')
-rw-r--r--rfc1035/rfc1035reply.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/rfc1035/rfc1035reply.c b/rfc1035/rfc1035reply.c
index ac1e87e..ab43dfb 100644
--- a/rfc1035/rfc1035reply.c
+++ b/rfc1035/rfc1035reply.c
@@ -489,7 +489,10 @@ void rfc1035_rr_rand_ar(struct rfc1035_reply *rr)
void rfc1035_rr_rand(struct rfc1035_reply *rr)
{
- rfc1035_rr_rand_an(rr);
- rfc1035_rr_rand_ns(rr);
- rfc1035_rr_rand_ar(rr);
+ if (rr->ancount > 1)
+ rfc1035_rr_rand_an(rr);
+ if (rr->nscount > 1)
+ rfc1035_rr_rand_ns(rr);
+ if (rr->arcount > 1)
+ rfc1035_rr_rand_ar(rr);
}