iface_lists: do not drop named pipes from interfaces list

(Named) pipes like "/tmp/fifo" or "-" have if_type == IF_WIRED instead
of IF_PIPE. Always try to add such interfaces such that "wireshark -i
/tmp/fifo" shows a "/tmp/fifo" item in the interfaces list.

Note that if an interface is really gone (like a disconnected USB
Ethernet device), then this could result in stale items in the list.

Ping-Bug: 13865
Fixes: v2.3.0rc0-2812-g40a5fb567a ("Restore interface selection after interface refresh")
Change-Id: Id05c65df332490a5bb789e4d6ca6404358edc3ec
Reviewed-on: https://code.wireshark.org/review/22407
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Anders 2017-06-26 16:42:06 +02:00 committed by Anders Broman
parent 9ff673d3e8
commit c5f296562f
1 changed files with 1 additions and 9 deletions

View File

@ -344,13 +344,6 @@ scan_local_interfaces(void (*update_cb)(void))
for (j = 0; j < global_capture_opts.ifaces->len; j++) {
interface_opts = g_array_index(global_capture_opts.ifaces, interface_options, j);
/* Skip non-pipes (like Ethernet, Wi-Fi, ...). */
if (interface_opts.if_type != IF_PIPE && interface_opts.if_type != IF_STDIN) {
/* Note: the interface options are not destroyed for these
* interfaces in case it is briefly removed and re-added. */
continue;
}
found = FALSE;
for (i = 0; i < (int)global_capture_opts.all_ifaces->len; i++) {
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
@ -367,8 +360,7 @@ scan_local_interfaces(void (*update_cb)(void))
g_strdup(device.name);
device.hidden = FALSE;
device.selected = TRUE;
/* XXX shouldn't this be interface_opts.if_type (for IF_STDIN)? */
device.type = IF_PIPE;
device.type = interface_opts.if_type;
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
device.buffer = interface_opts.buffer_size;
#endif