summaryrefslogtreecommitdiff
path: root/ui/iface_lists.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-11-26 02:44:21 +0000
committerGuy Harris <guy@alum.mit.edu>2013-11-26 02:44:21 +0000
commit261f69bc33064122cbcf2e25847a7a8f00607f36 (patch)
treeb4e600b6354cfad20e95a7aca7eb1202ca4f0ff3 /ui/iface_lists.c
parent4558ff0ef21e0b88186a01d3fb2dee8248d53faa (diff)
downloadwireshark-261f69bc33064122cbcf2e25847a7a8f00607f36.tar.gz
Actually, you can set the link-layer header type globally from the
command line, and it works as long as all interfaces on which you're capturing support it and that's what you really want. There's some UI cleanup that calls for, however. svn path=/trunk/; revision=53592
Diffstat (limited to 'ui/iface_lists.c')
-rw-r--r--ui/iface_lists.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index bfdfe294b0..378297edcb 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -215,21 +215,21 @@ scan_local_interfaces(void (*update_cb)(void))
#endif
/*
* If there's a preference for the link-layer header type for
- * this interface, use it.
- *
- * The global capture options has a link-layer header type,
- * but that's just because the capture options structure
- * has one; a global link-layer header type makes little
- * sense, as not all interfaces support the same sets of
- * link-layer header types, so we don't use it.
+ * this interface, use it. If not, use the all-interface
+ * default; if that's not set on the command line, that will
+ * be -1, meaning "use per-interface defaults", otherwise
+ * we'll fail if it's not one of the types the interface
+ * supports.
*/
- device.active_dlt = capture_dev_user_linktype_find(if_info->name);
+ if ((device.active_dlt = capture_dev_user_linktype_find(if_info->name)) == -1) {
+ device.active_dlt = global_capture_opts.default_options.linktype;
+ }
/*
* Process the list of link-layer header types.
* If the active link-layer header type wasn't set from a
- * preference (meaning it's -1), default to the first
- * link-layer header type in the list.
+ * preference or a global option (meaning it's -1), default
+ * to the first link-layer header type in the list.
*/
for (lt_entry = caps->data_link_types; lt_entry != NULL; lt_entry = g_list_next(lt_entry)) {
data_link_info = (data_link_info_t *)lt_entry->data;