summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2012-03-30 08:57:57 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2012-03-30 08:57:57 +0000
commit019008548bbaf3f575469c3c8f917a1b59331e12 (patch)
tree3906023cb44520e084508998a714584fe01f6153
parenteb262d2cc2cf5db5176bea81a815efe67e9e682f (diff)
downloadwireshark-019008548bbaf3f575469c3c8f917a1b59331e12.tar.gz
Recreate the packet list when changing UAT for header fields.
This fixes a crash when changing settings for fields used as a custom column. svn path=/trunk/; revision=41840
-rw-r--r--epan/dissectors/packet-http.c2
-rw-r--r--epan/dissectors/packet-imf.c2
-rw-r--r--epan/uat.h1
-rw-r--r--ui/gtk/uat_gui.c16
4 files changed, 16 insertions, 5 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index dea23230f7..fbf50ed544 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2722,7 +2722,7 @@ proto_register_http(void)
TRUE,
(void*) &header_fields,
&num_header_fields,
- UAT_CAT_GENERAL,
+ UAT_CAT_FIELDS,
NULL,
header_fields_copy_cb,
header_fields_update_cb,
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index 3985fadcd3..b9c69654eb 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -1216,7 +1216,7 @@ proto_register_imf(void)
TRUE,
(void*) &header_fields,
&num_header_fields,
- UAT_CAT_GENERAL,
+ UAT_CAT_FIELDS,
NULL,
header_fields_copy_cb,
header_fields_update_cb,
diff --git a/epan/uat.h b/epan/uat.h
index 53806ab9fa..50446ca0c2 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -226,6 +226,7 @@ typedef struct _uat_field_t {
#define UAT_CAT_PORTS "Port Assignments"
#define UAT_CAT_CRYPTO "Decryption"
#define UAT_CAT_FFMT "File Formats"
+#define UAT_CAT_FIELDS "Header Fields"
/** Create a new uat
*
diff --git a/ui/gtk/uat_gui.c b/ui/gtk/uat_gui.c
index bea21d33d4..4329ac2750 100644
--- a/ui/gtk/uat_gui.c
+++ b/ui/gtk/uat_gui.c
@@ -69,6 +69,7 @@
#include "ui/gtk/gui_stat_menu.h"
#include "ui/gtk/main.h"
#include "ui/gtk/uat_gui.h"
+#include "ui/gtk/new_packet_list.h"
#include "ui/gtk/old-gtk-compat.h"
# define BUTTON_SIZE_X -1
@@ -714,6 +715,15 @@ static void uat_down_cb(GtkButton *button _U_, gpointer u) {
set_buttons(uat,row);
}
+static void uat_apply_changes(uat_t *uat) {
+ if(strcmp(uat->category, UAT_CAT_FIELDS) == 0) {
+ /* Recreate list with new fields and redissect packets */
+ new_packet_list_recreate ();
+ } else if(cfile.state != FILE_CLOSED) {
+ redissect_packets ();
+ }
+}
+
static void uat_cancel_cb(GtkWidget *button _U_, gpointer u) {
uat_t* uat = u;
gchar* err = NULL;
@@ -726,7 +736,7 @@ static void uat_cancel_cb(GtkWidget *button _U_, gpointer u) {
report_failure("Error while loading %s: %s",uat->name,err);
}
- redissect_packets ();
+ uat_apply_changes (uat);
}
g_signal_handlers_disconnect_by_func(uat->rep->window, uat_window_delete_event_cb, uat);
@@ -741,7 +751,7 @@ static void uat_apply_cb(GtkButton *button _U_, gpointer u) {
if (uat->changed) {
if (uat->post_update_cb) uat->post_update_cb();
- redissect_packets ();
+ uat_apply_changes (uat);
}
}
@@ -757,7 +767,7 @@ static void uat_ok_cb(GtkButton *button _U_, gpointer u) {
}
if (uat->post_update_cb) uat->post_update_cb();
- redissect_packets ();
+ uat_apply_changes (uat);
}
g_signal_handlers_disconnect_by_func(uat->rep->window, uat_window_delete_event_cb, uat);