summaryrefslogtreecommitdiff
path: root/print-domain.c
diff options
context:
space:
mode:
authoritojun <itojun>2001-02-03 05:04:33 +0000
committeritojun <itojun>2001-02-03 05:04:33 +0000
commit0e44b855f2c80a7a812a523e95e801b3b90b1c98 (patch)
tree463959ac75bafe3520ffa7f8117f314124dfebc8 /print-domain.c
parent8fb4d4db58eae5d8d4c57a6209d4aab93cbf9154 (diff)
downloadtcpdump-0e44b855f2c80a7a812a523e95e801b3b90b1c98.tar.gz
fix query section decoding
Diffstat (limited to 'print-domain.c')
-rw-r--r--print-domain.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/print-domain.c b/print-domain.c
index 7cbfabd1..e095a1f5 100644
--- a/print-domain.c
+++ b/print-domain.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.68 2001-01-29 20:04:00 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.69 2001-02-03 05:04:33 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -489,16 +489,20 @@ ns_print(register const u_char *bp, u_int length)
if (qdcount != 1)
printf(" [%dq]", qdcount);
/* Print QUESTION section on -vv */
- if (vflag > 1) {
- fputs(" q:", stdout);
- if ((cp = ns_qprint((const u_char *)(np + 1), bp))
- == NULL)
- goto trunc;
- } else {
- if ((cp = ns_nskip((const u_char *)(np + 1), bp))
- == NULL)
- goto trunc;
- cp += 4;
+ while (qdcount--) {
+ if (qdcount < ntohs(np->qdcount) - 1)
+ putchar(',');
+ if (vflag > 1) {
+ fputs(" q:", stdout);
+ if ((cp = ns_qprint((const u_char *)(np + 1), bp))
+ == NULL)
+ goto trunc;
+ } else {
+ if ((cp = ns_nskip((const u_char *)(np + 1), bp))
+ == NULL)
+ goto trunc;
+ cp += 4; /* skip QTYPE and QCLASS */
+ }
}
printf(" %d/%d/%d", ancount, nscount, arcount);
if (ancount--) {