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

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

From: "Pia Sahlberg" <piabar@xxxxxxxxxxx>
Date: Wed, 26 Sep 2001 12:37:58 +0000
hi list

tiny tiny patch to enable dissection of icmp payload


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
diff -u -r -x *.[^ch]|nmake|am ethereal-orig/packet-ip.c ethereal/packet-ip.c
--- ethereal-orig/packet-ip.c	Wed Sep 26 09:26:18 2001
+++ ethereal/packet-ip.c	Wed Sep 26 09:27:34 2001
@@ -1161,6 +1161,7 @@
  guint8     num_addrs = 0;
  guint8     addr_entry_size = 0;
  int        i;
+  tvbuff_t   *new_tvb;

  if (check_col(pinfo->fd, COL_PROTOCOL))
    col_set_str(pinfo->fd, COL_PROTOCOL, "ICMP");
@@ -1337,10 +1338,11 @@
      case ICMP_REDIRECT:
	/* Decode the IP header and first 64 bits of data from the
	   original datagram.
+	*/
+	col_set_writable(pinfo->fd, FALSE);

-	   XXX - for now, just display it as data; not all dissection
-	   routines can handle a short packet without exploding. */
-	dissect_data(tvb, 8, pinfo, icmp_tree);
+	new_tvb = tvb_new_subset(tvb, 8, -1, -1);
+	dissect_ip(new_tvb, pinfo, icmp_tree);
	break;

      case ICMP_ECHOREPLY: