diff options
Diffstat (limited to 'capture_ifinfo.c')
-rw-r--r-- | capture_ifinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/capture_ifinfo.c b/capture_ifinfo.c index fc7a76e7d5..314a01ad1e 100644 --- a/capture_ifinfo.c +++ b/capture_ifinfo.c @@ -140,9 +140,9 @@ capture_interface_list(int *err, char **err_str) g_free(data); for (i = 0; raw_list[i] != NULL; i++) { - if_parts = g_strsplit(raw_list[i], "\t", 4); + if_parts = g_strsplit(raw_list[i], "\t", 5); if (if_parts[0] == NULL || if_parts[1] == NULL || if_parts[2] == NULL || - if_parts[3] == NULL) { + if_parts[3] == NULL || if_parts[4] == NULL) { g_strfreev(if_parts); continue; } @@ -160,7 +160,9 @@ capture_interface_list(int *err, char **err_str) if_info->name = g_strdup(name); if (strlen(if_parts[1]) > 0) if_info->description = g_strdup(if_parts[1]); - addr_parts = g_strsplit(if_parts[2], ",", 0); + if (strlen(if_parts[2]) > 0) + if_info->friendly_name = g_strdup(if_parts[2]); + addr_parts = g_strsplit(if_parts[3], ",", 0); for (j = 0; addr_parts[j] != NULL; j++) { if_addr = g_malloc0(sizeof(if_addr_t)); if (inet_pton(AF_INET, addr_parts[j], &if_addr->addr.ip4_addr)) { @@ -176,7 +178,7 @@ capture_interface_list(int *err, char **err_str) if_info->addrs = g_slist_append(if_info->addrs, if_addr); } } - if (strcmp(if_parts[3], "loopback") == 0) + if (strcmp(if_parts[4], "loopback") == 0) if_info->loopback = TRUE; g_strfreev(if_parts); g_strfreev(addr_parts); |