Ethereal-dev: [Ethereal-dev] Small bugfix for IPMI packet dissector

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

From: Duncan Laurie <duncan@xxxxxxx>
Date: Fri, 02 Apr 2004 12:42:40 -0700
Here is a small bugfix for the IPMI packet dissector that was causing
the LUN field to display the entire byte when it should only be the two
least significant bits.

-duncan

--- ethereal-2004-04-01.orig/packet-ipmi.c	2003-12-12 18:08:32.000000000 -0700
+++ ethereal-2004-04-01/packet-ipmi.c	2004-04-01 15:10:48.000000000 -0700
@@ -483,7 +483,7 @@
 		proto_tree_add_item(field_tree,
 				    response ? hf_ipmi_msg_rqlun : hf_ipmi_msg_rslun,
 				    tvb, offset, 1, TRUE);
-		lun = tvb_get_guint8(tvb, offset);
+		lun = tvb_get_guint8(tvb, offset) & 3;
 		proto_item_append_text(tf, ", LUN 0x%02x", lun);
 		offset += 1;
 	}
@@ -514,7 +514,7 @@
 		proto_tree_add_item(field_tree,
 				    response ? hf_ipmi_msg_rslun : hf_ipmi_msg_rqlun,
 				    tvb, offset, 1, TRUE);
-		lun = tvb_get_guint8(tvb, offset);
+		lun = tvb_get_guint8(tvb, offset) & 3;
 		proto_item_append_text(tf, ", LUN 0x%02x", lun);
 		offset += 1;
 	}