aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-sctp.c10
-rw-r--r--epan/packet_info.h3
-rw-r--r--epan/proto.c4
-rw-r--r--gtk/decode_as_dlg.c10
4 files changed, 15 insertions, 12 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index d4eff90553..8b63d426fc 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -1901,6 +1901,8 @@ dissect_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, gui
{
guint32 low_port, high_port;
+ pinfo->ppid = ppi;
+
if (enable_ulp_dissection) {
if (try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
@@ -2640,10 +2642,10 @@ dissect_data_chunk(tvbuff_t *chunk_tvb,
/* insert the PPID in the pinfo structure if it is non-zero, not already there and there is still room */
if (payload_proto_id) {
for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++)
- if ((pinfo->ppid[number_of_ppid] == 0) || (pinfo->ppid[number_of_ppid] == payload_proto_id))
+ if ((pinfo->ppids[number_of_ppid] == 0) || (pinfo->ppids[number_of_ppid] == payload_proto_id))
break;
- if ((number_of_ppid < MAX_NUMBER_OF_PPIDS) && (pinfo->ppid[number_of_ppid] == 0))
- pinfo->ppid[number_of_ppid] = payload_proto_id;
+ if ((number_of_ppid < MAX_NUMBER_OF_PPIDS) && (pinfo->ppids[number_of_ppid] == 0))
+ pinfo->ppids[number_of_ppid] = payload_proto_id;
}
e_bit = tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_DATA_CHUNK_E_BIT;
@@ -3653,7 +3655,7 @@ dissect_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "");
- memset(&pinfo->ppid, 0, sizeof(pinfo->ppid));
+ memset(&pinfo->ppids, 0, sizeof(pinfo->ppids));
/* The tvb array in struct _sctp_info is huge: currently 2k pointers.
* We know (by the value of 'number_of_tvbs') which of these entries have
diff --git a/epan/packet_info.h b/epan/packet_info.h
index eb963b6532..5970344f1a 100644
--- a/epan/packet_info.h
+++ b/epan/packet_info.h
@@ -163,7 +163,8 @@ typedef struct _packet_info {
tvbuff_t *gssapi_decrypted_tvb;
gboolean gssapi_data_encrypted;
- guint32 ppid[MAX_NUMBER_OF_PPIDS]; /* The first NUMBER_OF_PPIDS PPIDS which are present
+ guint32 ppid; /* SCTP PPI of current DATA chunk */
+ guint32 ppids[MAX_NUMBER_OF_PPIDS]; /* The first NUMBER_OF_PPIDS PPIDS which are present
* in the SCTP packet
*/
void *private_data; /* pointer to data passed from one dissector to another */
diff --git a/epan/proto.c b/epan/proto.c
index 594884bf32..5d69fc1e0d 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -2537,9 +2537,9 @@ proto_tree_set_uint(field_info *fi, guint32 value)
col_custom_set_fstr(fi->hfinfo, "%s", integer ? tfstring->true_string : tfstring->false_string);
} else if (hfinfo->strings) {
if (hfinfo->display & BASE_RANGE_STRING) {
- col_custom_set_fstr(fi->hfinfo, "%s", rval_to_str(integer, hfinfo->strings, "%d"));
+ col_custom_set_fstr(fi->hfinfo, "%s", rval_to_str(integer, hfinfo->strings, "%u"));
} else {
- col_custom_set_fstr(fi->hfinfo, "%s", val_to_str(integer, cVALS(hfinfo->strings), "%d"));
+ col_custom_set_fstr(fi->hfinfo, "%s", val_to_str(integer, cVALS(hfinfo->strings), "%u"));
}
} else if (IS_BASE_DUAL(hfinfo->display)) {
col_custom_set_fstr(fi->hfinfo, hfinfo_uint_value_format(hfinfo), integer, integer);
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 24d469da66..edb25a96f6 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -770,7 +770,7 @@ decode_transport(GtkWidget *notebook_pg)
ppid = 0;
else
if (requested_srcdst - E_DECODE_PPID - 1 < MAX_NUMBER_OF_PPIDS)
- ppid = cfile.edt->pi.ppid[requested_srcdst - E_DECODE_PPID - 1];
+ ppid = cfile.edt->pi.ppids[requested_srcdst - E_DECODE_PPID - 1];
else
return;
decode_change_one_dissector(table_name, ppid, list);
@@ -1100,8 +1100,8 @@ decode_add_ppid_menu (GtkWidget *page)
gtk_widget_show(menuitem); /* gtk_widget_show_all() doesn't show this */
for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++)
- if (cfile.edt->pi.ppid[number_of_ppid] != 0) {
- g_snprintf(tmp, 100, "PPID (%u)", cfile.edt->pi.ppid[number_of_ppid]);
+ if (cfile.edt->pi.ppids[number_of_ppid] != 0) {
+ g_snprintf(tmp, 100, "PPID (%u)", cfile.edt->pi.ppids[number_of_ppid]);
menuitem = gtk_menu_item_new_with_label(tmp);
g_object_set_data(G_OBJECT(menuitem), "user_data", GINT_TO_POINTER(E_DECODE_PPID + 1 + number_of_ppid));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
@@ -1498,8 +1498,8 @@ decode_sctp_update_ppid_menu(GtkWidget *w _U_, GtkWidget *page)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
gtk_widget_show(menuitem); /* gtk_widget_show_all() doesn't show this */
for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++)
- if (cfile.edt->pi.ppid[number_of_ppid] != 0) {
- g_snprintf(tmp, 100, "PPID (%u)", cfile.edt->pi.ppid[number_of_ppid]);
+ if (cfile.edt->pi.ppids[number_of_ppid] != 0) {
+ g_snprintf(tmp, 100, "PPID (%u)", cfile.edt->pi.ppids[number_of_ppid]);
menuitem = gtk_menu_item_new_with_label(tmp);
g_object_set_data(G_OBJECT(menuitem), "user_data", GINT_TO_POINTER(E_DECODE_PPID + 1 + number_of_ppid));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);