diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-11-22 06:02:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-11-22 06:02:49 +0000 |
commit | bd976ae6c06b2111bd82df16b77739731dc17402 (patch) | |
tree | 406d65d00129abb45868150687f267a139bbf670 /capture_opts.c | |
parent | b9e8e95ffe9f352cde5847d458081826523cf46f (diff) |
On UN*X, if an interface has a description, use it as the "friendly
name". If it doesn't have a description, on OS X, use the System
Configuration framework to attempt to get a "friendly name" for
interfaces.
If a loopback device doesn't have a friendly name, give it "Loopback" as
the friendly name.
Move the "turn a CFString into a mallocated C string" routine into
common code, as it's used in more than one place.
svn path=/trunk/; revision=46131
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/capture_opts.c b/capture_opts.c index 3f9dd3b099..52e5e6429a 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -874,13 +874,13 @@ capture_opts_print_interfaces(GList *if_list) if_info = (if_info_t *)if_entry->data; fprintf_stderr("%d. %s", i++, if_info->name); - /* print the interface friendly name if known, if not fall back to vendor description */ + /* Print the interface friendly name, if it exists; + if not fall back to vendor description, if it exists. */ if (if_info->friendly_name != NULL){ fprintf_stderr(" (%s)", if_info->friendly_name); - }else{ - /* Print the description if it exists */ - if (if_info->description != NULL) - fprintf_stderr(" (%s)", if_info->description); + } else { + if (if_info->vendor_description != NULL) + fprintf_stderr(" (%s)", if_info->vendor_description); } fprintf_stderr("\n"); } |