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
This commit is contained in:
Anders Broman 2013-01-17 12:21:57 +00:00
parent bff31de434
commit 402906be13
1 changed files with 15 additions and 9 deletions

View File

@ -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);