qt: Refresh local interface list only when interfaces added/removed

Whenever data is received on the iface monitor socket the list of
local network interfaces is refreshed. No check whether an interface
is really added/removed is done. Changes to network interface options
like promiscous mode flag generate traffic on the iface monitor socket
that not necessarily mean an interface was brought up or down resulting
in an unwanted refresh of local interfaces.

When local interfaces are refreshed selected capture interface(s) get
deselected. This in turn makes "Restart current capture" fail with a no
capture interface selected error.

Fixed by moving the refresh action from socket monitor callback to iface
monitor callback where interface up/down status is known.

Bug: 11834
Change-Id: Iffd39c3240049880b5a8311bc6484f3d1433f387
Reviewed-on: https://code.wireshark.org/review/12317
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Mikael Kanstrup 2015-11-30 22:25:35 +01:00 committed by Guy Harris
parent d7ddebbfb2
commit 74747489ac
1 changed files with 1 additions and 9 deletions

View File

@ -820,7 +820,7 @@ iface_mon_event_cb(const char *iface, int up)
* We've been told that there's a new interface or that an old
* interface is gone; reload the local interface list.
*/
scan_local_interfaces(main_window_update);
wsApp->refreshLocalInterfaces();
}
}
@ -837,14 +837,6 @@ void WiresharkApplication::ifChangeEventsAvailable()
* events are available, and call the callback for them.
*/
iface_mon_event();
/*
* Now emit a signal to indicate that the list changed, so that all
* places displaying the list will get updated.
*
* XXX - only if it *did* change.
*/
emit localInterfaceListChanged();
#endif
}