Ethereal-dev: [Ethereal-dev] Modbus/TCP patch

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Stephen Shelley <steve.shelley@xxxxxxxxx>
Date: Wed, 07 May 2003 17:49:41 -0400
Patch to fix problem with unit ID and function code whereby they were interpreted as signed, rather than unsigned, bytes.

Steve Shelley

------------------------------------------------------------------------

Women and cats will do as they please, and men and dogs should relax and get used to the idea.

	- Robert A. Heinlein

Index: ethereal/packet-mbtcp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-mbtcp.c,v
retrieving revision 1.13
diff -u -r1.13 packet-mbtcp.c
--- ethereal/packet-mbtcp.c	18 Apr 2003 04:45:00 -0000	1.13
+++ ethereal/packet-mbtcp.c	7 May 2003 21:48:20 -0000
@@ -96,8 +96,8 @@
 
 /* Modbus header */
 typedef struct _modbus_hdr {
-	gchar	unit_id;	/* unit identifier (previously slave addr) */
-	gchar	function_code; 	/* Modbus function code */
+	guchar	unit_id;	/* unit identifier (previously slave addr) */
+	guchar	function_code; 	/* Modbus function code */
 } modbus_hdr;
 
 /* Modbus/TCP header, containing the Modbus header */