From 4c019d6807d975ae6d8b0f27311c7ed844ac3c7f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 21 Nov 2012 17:33:02 +0000 Subject: [PATCH] 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 --- capture_opts.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/capture_opts.c b/capture_opts.c index 939a6437f5..fad401c6c7 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -24,6 +24,8 @@ #include "config.h" +#include + #ifdef HAVE_LIBPCAP #include @@ -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);