aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-01-17 12:21:57 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-01-17 12:21:57 +0000
commit402906be1328f6dc36d71f3aed13ab3437ae2f6a (patch)
tree7b932cf022ffc4774b54de8d350d396e3d422218 /ui
parentbff31de43473c322163cb227c1a2df5aba48c6e9 (diff)
Opening the capture options triggers a rescan of all the packets caused by the call to update_decryption_mode_list() for airpcap.
If we don't get the airpcap_if_list, don't do anything regarding air_pcap. update_decryption_mode_list() should probably check if a change is taking place before rescaning all packets. svn path=/trunk/; revision=47131
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/capture_dlg.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index d3a9587dd9..083d473001 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -4429,16 +4429,22 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
/* load the airpcap interfaces */
airpcap_if_list = get_airpcap_interface_list(&err, &err_str);
- decryption_cb = g_object_get_data(G_OBJECT(wireless_tb),AIRPCAP_TOOLBAR_DECRYPTION_KEY);
- update_decryption_mode_list(decryption_cb);
-
- if (airpcap_if_list == NULL && err == CANT_GET_AIRPCAP_INTERFACE_LIST) {
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
- g_free(err_str);
+ /* If we don't get a list don't do any thing.
+ * If the error is AIRPCAP_NOT_LOADED it avoids a unneccessay rescan of the packet list
+ * ( see airpcap_loader.h for error codes).
+ */
+ if (airpcap_if_list == NULL) {
+ if (err == CANT_GET_AIRPCAP_INTERFACE_LIST) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
+ g_free(err_str);
+ }
+ }else{
+ decryption_cb = g_object_get_data(G_OBJECT(wireless_tb),AIRPCAP_TOOLBAR_DECRYPTION_KEY);
+ /* XXXX update_decryption_mode_list() trigers a rescan, should only be done if the mode is changed */
+ update_decryption_mode_list(decryption_cb);
+ /* select the first as default (THIS SHOULD BE CHANGED) */
+ airpcap_if_active = airpcap_get_default_if(airpcap_if_list);
}
-
- /* select the first as default (THIS SHOULD BE CHANGED) */
- airpcap_if_active = airpcap_get_default_if(airpcap_if_list);
#endif
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 0, FALSE);