Wireshark-users: Re: [Wireshark-users] small bug in dissecting DHCPv4 relay suboptions
From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Fri, 26 Oct 2007 07:13:13 +0200
Hi,

This is a good start. Now go ahead and decode the other options as well and then open a bug report and attach the patch to that.
See http://wiki.wireshark.org/Development/PatchHandling

Thanx,
Jaap

Stefan Puiu wrote:
Joerg Mayer <jmayer@...> writes:

On Thu, Oct 25, 2007 at 09:56:13AM +0000, Stefan Puiu wrote:
If needed, I can provide a capture file that exhibits the problem.
A capture file and a patch would be very nice indeed.

Thanks!

  Joerg

Here's a patch that handles suboption 6. I haven't added the other suboptions
because I was too lazy to check any format particularities. I've also changed
the error message.
Index: epan/dissectors/packet-bootp.c
===================================================================
--- epan/dissectors/packet-bootp.c	(revision 23272)
+++ epan/dissectors/packet-bootp.c	(working copy)
@@ -1601,7 +1601,11 @@
 				    "Agent Remote ID: %s",
 				    tvb_bytes_to_str(tvb, suboptoff, subopt_len));
 		break;
-
+    case 6:
+		proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
+				    "Subscriber ID: %s",
+				    tvb_bytes_to_str(tvb, suboptoff, subopt_len));
+		break;
 	case 9:
 		while (suboptoff < optend) {
 			enterprise = tvb_get_ntohl(tvb, suboptoff);
@@ -1624,7 +1628,7 @@
default:
 		proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
-				    "Invalid agent suboption %d (%d bytes)",
+				    "Unknown agent suboption %d (%d bytes)",
 				    subopt, subopt_len);
 		break;
 	}

Stefan