Ethereal-dev: [Ethereal-dev] patch for packet-smb.c (Locking_AndX)

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

From: "Luis Claudio R. Goncalves" <lclaudio@xxxxxxxxxxxxxxxx>
Date: Fri, 7 Nov 2003 18:02:24 -0200
Hi!

I've been playing around with locks in samba and I've seen that the offset
and length reported by ethereal for large file locks are not the same I've
requested and thus not the same reported by samba logs.

The locking offset and length are 64bit integers sent as OffsetHigh (32bit)
and OffsetLow (32bit). The glitch seems to be only the mix between high and
low 32bit words.

The patch attached just does a little change in
dissect_locking_andx_request(), file packet-smb.c

I tried it with ethereal-0.9.10 and I've seen that this code still be the
same in 0.9.16.

Regards,
Luis

PS: I'm not subscribed to this mailing list... :)
-- 
[ Luis Claudio R. Goncalves                  lclaudio@xxxxxxxxxxxxxxxx ]
[ Fingerprint:   4FDD B8C4 3C59 34BD 8BE9  2696 7203 D980 A448 C8F8    ]
[ Msc has come!!!! - Conectiva HA Team - Gospel User - Linuxer - !Java ]
[ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ]
[ LateNite Programmer        --  My Utmost for His Highest  --         ]


--- ethereal-0.9.16/packet-smb.c	2003-10-26 00:10:50.000000000 -0200
+++ ethereal-0.9.16/packet-smb-new.c	2003-11-07 09:52:03.000000000 -0200
@@ -4756,12 +4756,12 @@
 
 				/* offset */
 				CHECK_BYTE_COUNT(8);
-				val=tvb_get_letohl(tvb, offset);
+				val=tvb_get_letohl(tvb, offset+4);
 				buf[3]=(val>>24)&0xff;
 				buf[2]=(val>>16)&0xff;
 				buf[1]=(val>> 8)&0xff;
 				buf[0]=(val    )&0xff;
-				val=tvb_get_letohl(tvb, offset+4);
+				val=tvb_get_letohl(tvb, offset);
 				buf[7]=(val>>24)&0xff;
 				buf[6]=(val>>16)&0xff;
 				buf[5]=(val>> 8)&0xff;
@@ -4771,12 +4771,12 @@
 
 				/* length */
 				CHECK_BYTE_COUNT(8);
-				val=tvb_get_letohl(tvb, offset);
+				val=tvb_get_letohl(tvb, offset+4);
 				buf[3]=(val>>24)&0xff;
 				buf[2]=(val>>16)&0xff;
 				buf[1]=(val>> 8)&0xff;
 				buf[0]=(val    )&0xff;
-				val=tvb_get_letohl(tvb, offset+4);
+				val=tvb_get_letohl(tvb, offset);
 				buf[7]=(val>>24)&0xff;
 				buf[6]=(val>>16)&0xff;
 				buf[5]=(val>> 8)&0xff;