ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-users: Re: [Wireshark-users] small bug in dissecting DHCPv4 relay suboptions

From: Stefan Puiu <stefan.puiu@xxxxxxxxx>
Date: Thu, 25 Oct 2007 22:28:02 +0000 (UTC)
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