aboutsummaryrefslogtreecommitdiffstats
path: root/ui/capture_ui_utils.c
diff options
context:
space:
mode:
authorIrene Ruengeler <ruengeler@wireshark.org>2014-06-24 11:36:51 +0200
committerMichael Tüxen <tuexen@wireshark.org>2014-07-02 20:56:37 +0000
commitf3c5f14bc440f4f8d8c680c4834a59ef5ba606a4 (patch)
tree50a8f68717109ef299e00e176c4467eaf4832cce /ui/capture_ui_utils.c
parent2c9d2bea32238223634ae975cfd4e682ba1a0b2b (diff)
Manage Interfaces
- Add dialog to manage interfaces - Add and delete pipes - Hide local interfaces Change-Id: I08323c306c2ea736f99e57c28e2fe3170a0c2216 Reviewed-on: https://code.wireshark.org/review/2613 Tested-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
Diffstat (limited to 'ui/capture_ui_utils.c')
-rw-r--r--ui/capture_ui_utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/capture_ui_utils.c b/ui/capture_ui_utils.c
index 1cd06c619a..2970ddd5e9 100644
--- a/ui/capture_ui_utils.c
+++ b/ui/capture_ui_utils.c
@@ -44,7 +44,7 @@
char *
capture_dev_user_descr_find(const gchar *if_name)
{
- char *p;
+ char *p, *str;
char *p2 = NULL;
char *descr = NULL;
int lp = 0;
@@ -56,11 +56,15 @@ capture_dev_user_descr_find(const gchar *if_name)
return NULL;
}
- if ((p = strstr(prefs.capture_devices_descr, if_name)) == NULL) {
+ /* There might be names like 'lo' and 'nflog' in Ubuntu which can lead to wrong results.
+ Therefore, the search must be more exact. */
+ str = g_strdup_printf(",%s(", if_name);
+ if ((p = strstr(prefs.capture_devices_descr, str)) == NULL) {
/* There are, but there isn't one for this interface. */
return NULL;
}
+ p++;
while (*p != '\0') {
/* error: ran into next interface description */
if (*p == ',')
@@ -85,6 +89,7 @@ capture_dev_user_descr_find(const gchar *if_name)
}
}
+ g_free(str);
if ((lp == 1) && (ct > 0) && (p2 != NULL)) {
/* Allocate enough space to return the string,
which runs from p2 to p, plus a terminating