Ethereal-dev: [ethereal-dev] WAP WTP patch for packet-wtp.c

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

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxxxxxx>
Date: Tue, 17 Apr 2001 12:06:17 +0200
Hi all!

There's a small bug in the WAP WTP decoding (packet-wtp.c): not all PDU
types have a retransmission identification bit.  The patch below fixes the
problem:

=== LEGEND ===
--- OLD: ethereal-0.8.17/packet-wtp.c (version 1.12)
+++ NEW: ethereal/packet-wtp.c
=== BEGIN ===
 static char retransmission_indicator(unsigned char octet)
 {
-	char ch = (octet >> 0) & 0x01; /* ......,X */
-	return ch;
+	switch ( pdu_type(octet) ) {
+		case INVOKE:
+		case RESULT:
+		case ACK:
+		case SEGMENTED_INVOKE:
+		case SEGMENTED_RESULT:
+		case NEGATIVE_ACK:
+			return (octet >> 0) & 0x01; /* ......,X */
+		default:
+			return 0;
+	}
 };
=== END ===

Regards,

Olivier