If we don't find the specified interface name in the list, use it

anyway, so that, for example, if an interface doesn't show up in the
list for some reason, the user can try specifying it explicitly for
testing purposes.

svn path=/trunk/; revision=46109
This commit is contained in:
Guy Harris 2012-11-21 17:33:02 +00:00
parent d415d3d87c
commit 4c019d6807
1 changed files with 11 additions and 3 deletions

View File

@ -24,6 +24,8 @@
#include "config.h"
#include <stdio.h>
#ifdef HAVE_LIBPCAP
#include <string.h>
@ -569,10 +571,16 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
}
}
if (!matched) {
cmdarg_err("Failed to match interface '%s'", optarg_str_p);
return 1;
/*
* We didn't find the interface in the list; just use
* the specified name, so that, for example, if an
* interface doesn't show up in the list for some
* reason, the user can try specifying it explicitly
* for testing purposes.
*/
interface_opts.name = g_strdup(optarg_str_p);
interface_opts.console_display_name = g_strdup(optarg_str_p);
}
}
free_interface_list(if_list);