aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-12-29 10:36:13 +0000
committerGuy Harris <guy@alum.mit.edu>1999-12-29 10:36:13 +0000
commit168069a36d17b39cb24e0210e836c896bdfe9f6d (patch)
treef1e96310d426bc9b349885e0b7b2912be0401a65 /packet-dns.c
parent868eb7518a7916f2a401595f61fe5f958bdb578a (diff)
Get rid of the "(UDP)" in the DNS protocol string.
If a DNS response got an error, include the error indication in the summary line. svn path=/trunk/; revision=1391
Diffstat (limited to 'packet-dns.c')
-rw-r--r--packet-dns.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/packet-dns.c b/packet-dns.c
index 36c8a40ec4..dec4c7a123 100644
--- a/packet-dns.c
+++ b/packet-dns.c
@@ -1,7 +1,7 @@
/* packet-dns.c
* Routines for DNS packet disassembly
*
- * $Id: packet-dns.c,v 1.32 1999/12/07 00:22:10 nneul Exp $
+ * $Id: packet-dns.c,v 1.33 1999/12/29 10:36:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1346,7 +1346,7 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
dns_data_offset = offset;
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "DNS (UDP)");
+ col_add_str(fd, COL_PROTOCOL, "DNS");
if (pi.captured_len < DNS_HDRLEN) {
col_add_str(fd, COL_INFO, "Short DNS packet");
@@ -1363,10 +1363,16 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
add = pntohs(&pd[offset + DNS_ADD]);
if (check_col(fd, COL_INFO)) {
- col_add_fstr(fd, COL_INFO, "%s%s",
- val_to_str(flags & F_OPCODE, opcode_vals,
- "Unknown operation (%x)"),
- (flags & F_RESPONSE) ? " response" : "");
+ strcpy(buf, val_to_str(flags & F_OPCODE, opcode_vals, "Unknown operation (%x)"));
+ if (flags & F_RESPONSE) {
+ strcat(buf, " response");
+ if ((flags & F_RCODE) != RCODE_NOERROR) {
+ strcat(buf, ", ");
+ strcat(buf, val_to_str(flags & F_RCODE, rcode_vals,
+ "Unknown error (%x)"));
+ }
+ }
+ col_add_str(fd, COL_INFO, buf);
} else {
/* Set "fd" to NULL; we pass a NULL "fd" to the query and answer
dissectors, as a way of saying that they shouldn't add stuff