Ethereal-dev: [Ethereal-dev] smb vs dcerpc error handling

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

From: Tim Potter <tpot@xxxxxxxxx>
Date: Wed, 30 Jan 2002 13:20:17 +1100
Hi everyone.  I have noticed that error handling in smb and dcerpc seems
to fall over itself when there is an error value set in both the smb
packet and the dcerpc packet encapsulated within.  The info field 
displays the SMB error when often the dcerpc packet contains no error
and the packet has just been fragmented.

I'm suggesting that the smb error is appended to the info field before 
the smb is dissected so a higher level protocol has a chance to overwrite the
info string with it's own message.


Tim.

Index: packet-smb.c
===================================================================
RCS file: /cvsroot/ethereal/packet-smb.c,v
retrieving revision 1.202
diff -u -r1.202 packet-smb.c
--- packet-smb.c        2002/01/29 21:49:43     1.202
+++ packet-smb.c        2002/01/30 02:12:43
@@ -13961,9 +13961,6 @@
        proto_tree_add_uint(htree, hf_smb_mid, tvb, offset, 2, mid);
        offset += 2;
 
-       pinfo->private_data = &si;
-        dissect_smb_command(tvb, pinfo, parent_tree, offset, tree, si.cmd);
-
        /* Append error info from this packet to info string. */
        if (!si.request && check_col(pinfo->cinfo, COL_INFO)) {
                if (flags2 & 0x4000) {
@@ -13994,6 +13991,9 @@
                        }
                }
        }
+
+       pinfo->private_data = &si;
+        dissect_smb_command(tvb, pinfo, parent_tree, offset, tree, si.cmd);
 
        return TRUE;
 }