Skip to content

Commit 6d207fe

Browse files
committed
Remove private_data member from packet_info structure.
Dissectors should pass data directly to their subdissectors through the data parameter (of new-style dissectors). This avoids unintentional "trampling" from other dissectors trying to "share" private_data member. Change-Id: I2efef5c8dfeef64588ba3ac6e695b469238c6468 Reviewed-on: https://code.wireshark.org/review/5487 Petri-Dish: Michael Mann <[email protected]> Reviewed-by: Michael Mann <[email protected]>
1 parent e77507b commit 6d207fe

File tree

5 files changed

+0
-10
lines changed

5 files changed

+0
-10
lines changed

epan/dissectors/packet-dcerpc.c

-2
Original file line numberDiff line numberDiff line change
@@ -4685,8 +4685,6 @@ is_dcerpc(tvbuff_t *tvb, int offset, packet_info *pinfo _U_)
46854685

46864686
/*
46874687
* DCERPC dissector for connection oriented calls.
4688-
* We use transport type to later multiplex between what kind of
4689-
* pinfo->private_data structure to expect.
46904688
*/
46914689
static gboolean
46924690
dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,

epan/packet_info.h

-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ typedef struct _packet_info {
148148
tvbuff_t *gssapi_decrypted_tvb;
149149
gboolean gssapi_data_encrypted;
150150

151-
void *private_data; /**< pointer to data passed from one dissector to another */
152151
GHashTable *private_table; /**< a hash table passed from one dissector to another */
153152

154153
wmem_list_t *layers; /**< layers of each protocol */

epan/wslua/wslua_pinfo.c

-4
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,6 @@ PINFO_NUMBER_SETTER(desegment_len,guint32);
968968
PINFO_NUMBER_GETTER(desegment_offset);
969969
PINFO_NUMBER_SETTER(desegment_offset,int);
970970

971-
/* WSLUA_ATTRIBUTE Pinfo_private_data RO Access to private data. */
972-
WSLUA_ATTRIBUTE_GET(Pinfo,private_data, {lua_pushlightuserdata(L,(void *)(obj->ws_pinfo->private_data));});
973-
974971
/* WSLUA_ATTRIBUTE Pinfo_fragmented RO If the protocol is only a fragment. */
975972
PINFO_NAMED_BOOLEAN_GETTER(fragmented,fragmented);
976973

@@ -1178,7 +1175,6 @@ WSLUA_ATTRIBUTES Pinfo_attributes[] = {
11781175
WSLUA_ATTRIBUTE_RWREG(Pinfo,can_desegment),
11791176
WSLUA_ATTRIBUTE_RWREG(Pinfo,desegment_len),
11801177
WSLUA_ATTRIBUTE_RWREG(Pinfo,desegment_offset),
1181-
WSLUA_ATTRIBUTE_ROREG(Pinfo,private_data),
11821178
WSLUA_ATTRIBUTE_ROREG(Pinfo,private),
11831179
WSLUA_ATTRIBUTE_ROREG(Pinfo,fragmented),
11841180
WSLUA_ATTRIBUTE_ROREG(Pinfo,in_error_pkt),

plugins/profinet/packet-dcom-cba-acco.c

-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name)
542542

543543
cba_ldev_t *
544544
cba_ldev_find(packet_info *pinfo, const void *ip, e_uuid_t *ipid) {
545-
/*dcerpc_info *info = (dcerpc_info *)pinfo->private_data;*/
546545
dcom_interface_t *interf;
547546
cba_ldev_t *ldev;
548547

test/lua/pinfo.lua

-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ silently accept being set (though nothing happens) Blech!!
123123
test("Pinfo.curr_proto-set-1",not pcall(setPinfo,pinfo,"curr_proto",0))
124124
test("Pinfo.columns-set-1",not pcall(setPinfo,pinfo,"columns",0))
125125
test("Pinfo.cols-set-1",not pcall(setPinfo,pinfo,"cols",0))
126-
test("Pinfo.private_data-set-1",not pcall(setPinfo,pinfo,"private_data",0))
127126
test("Pinfo.private-set-1",not pcall(setPinfo,pinfo,"private",0))
128127
test("Pinfo.fragmented-set-1",not pcall(setPinfo,pinfo,"fragmented",0))
129128
test("Pinfo.in_error_pkt-set-1",not pcall(setPinfo,pinfo,"in_error_pkt",0))
@@ -188,7 +187,6 @@ again, these *should* pass, but Pinfo silently allows it!
188187
test("Pinfo.columns-get-2",typeof(pinfo.columns) == "Columns")
189188
test("Pinfo.cols-get-1",tostring(pinfo.cols) == "Columns")
190189
test("Pinfo.cols-get-2",typeof(pinfo.cols) == "Columns")
191-
test("Pinfo.private_data-get-1",type(pinfo.private_data) == "userdata")
192190
test("Pinfo.private-get-1",type(pinfo.private) == "userdata")
193191
test("Pinfo.fragmented-get-1",pinfo.fragmented == false)
194192

0 commit comments

Comments
 (0)