Ethereal-dev: [ethereal-dev] packet-ip.c patch

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

From: Daniel Ryde <ryde@xxxxxxxxxx>
Date: Thu, 2 Sep 1999 10:04:58 +0200 (CEST)
Hi,

Below is a small modification on packet-ip.c that fixes the length of the
fragmentation flags.

Another note:
I kind of dislike not see the exakt position/length down to the bit size 
of data that is displayed. Everything seems to boil down to bytes sizes
in the hex/char window. It would be nice to be able to configure the data
window displaying hex, binary, octal, char, you name it columns. Adding a
mask to proto_tree_add_item* is the first thing that comes to mind...


/Dr

--- packet-ip.c.orig	Wed Sep  1 18:08:00 1999
+++ packet-ip.c	Wed Sep  1 18:25:11 1999
@@ -772,11 +772,11 @@
     tf = proto_tree_add_item_format(ip_tree, hf_ip_flags, offset +  6, 1, flags,
 		   "Flags: 0x%x", flags);
     field_tree = proto_item_add_subtree(tf, ETT_IP_OFF);
-    proto_tree_add_text(field_tree, offset + 6, 2, "%s",
-      decode_boolean_bitfield(iph.ip_off >> 8, IP_DF >> 8, 8, "don't fragment",
+    proto_tree_add_text(field_tree, offset + 6, 1, "%s",
+      decode_boolean_bitfield(iph.ip_off >> 12, IP_DF >> 12, 4, "don't fragment",
                                            "may fragment"));
-    proto_tree_add_text(field_tree, offset + 6, 2, "%s",
-      decode_boolean_bitfield(iph.ip_off >> 8, IP_MF >> 8, 8, "more fragments",
+    proto_tree_add_text(field_tree, offset + 6, 1, "%s",
+      decode_boolean_bitfield(iph.ip_off >> 12, IP_MF >> 12, 4, "more fragments",
                                            "last fragment"));
 
     proto_tree_add_item(ip_tree, hf_ip_frag_offset, offset +  6, 2,