aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2016-10-21 11:28:18 +0200
committerDario Lombardo <lomato@gmail.com>2016-10-21 11:55:26 +0000
commit67bfdf28714a5945a78aef9d745d88fd69972578 (patch)
tree2ba9da17711cb2a73e746f4e4a80a68a3816f2e1
parent25207d70bb9938c2c00ddc0e26f5c85d9d8616ca (diff)
capchild: Fix loading of extcap with no winpcap.dll
If the loading of the physical interface list failed, no extcap interfaces will be loaded as well. Fix that, so that we search for the extcap interfaces, even when no other interfaces have been found Change-Id: Ib8e86f1f8d2a1565724ef3532d41ecea3ceddb55 Reviewed-on: https://code.wireshark.org/review/18352 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
-rw-r--r--capchild/capture_ifinfo.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/capchild/capture_ifinfo.c b/capchild/capture_ifinfo.c
index 8e4c59fa4e..15991ac357 100644
--- a/capchild/capture_ifinfo.c
+++ b/capchild/capture_ifinfo.c
@@ -111,16 +111,29 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void))
/* Try to get our interface list */
ret = sync_interface_list_open(&data, &primary_msg, &secondary_msg, update_cb);
if (ret != 0) {
- g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed, error %d, %s (%s)!",
- *err, primary_msg ? primary_msg : "no message",
- secondary_msg ? secondary_msg : "no secondary message");
- if (err_str) {
- *err_str = primary_msg;
- } else {
- g_free(primary_msg);
+#ifdef HAVE_EXTCAP
+ /* Add the extcap interfaces that can exist, even if no native interfaces have been found */
+ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Loading External Capture Interface List ...");
+ if_list = append_extcap_interface_list(if_list, err_str);
+ /* err_str is ignored, as the error for the interface loading list will take precedence */
+ if ( g_list_length(if_list) == 0 ) {
+#endif
+
+ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed, error %d, %s (%s)!",
+ *err, primary_msg ? primary_msg : "no message",
+ secondary_msg ? secondary_msg : "no secondary message");
+ if (err_str) {
+ *err_str = primary_msg;
+ } else {
+ g_free(primary_msg);
+ }
+ g_free(secondary_msg);
+ *err = CANT_GET_INTERFACE_LIST;
+
+#ifdef HAVE_EXTCAP
}
- g_free(secondary_msg);
- *err = CANT_GET_INTERFACE_LIST;
+#endif
+
return if_list;
}