aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_interfaces_dialog.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-03-22 16:58:42 -0700
committerGuy Harris <guy@alum.mit.edu>2015-03-23 00:00:42 +0000
commit1b4120846ee1a139f7d3ff9c2bfe2eab593745bb (patch)
treef500d385ecbe57b324b5eda1dd6875893630beeb /ui/qt/capture_interfaces_dialog.cpp
parentc474bb86912aedb13669fb14627b2ad29f082b40 (diff)
Centralize the code to set the active_dlt value for a device.
We were doing it similarly, but not the same, in several places; make a common routine for it. Have that code check to make sure the DLT_ value in question is actually supported by the device; if not, pick the first supported DLT_ value, if any; this keeps it from, for example, picking a bad DLT_ value if your defaults were set based on monitor mode being on but monitor mode actually being off, or vice versa. Change-Id: I1722bfeaf60429bc5c6f665fdea3d466052b13bd Reviewed-on: https://code.wireshark.org/review/7795 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/capture_interfaces_dialog.cpp')
-rw-r--r--ui/qt/capture_interfaces_dialog.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp
index f1c8539429..2e164770f0 100644
--- a/ui/qt/capture_interfaces_dialog.cpp
+++ b/ui/qt/capture_interfaces_dialog.cpp
@@ -487,10 +487,9 @@ void CaptureInterfacesDialog::updateInterfaces()
ti->setToolTip(col_interface_, tr("no addresses"));
}
+ set_active_dlt(device, global_capture_opts.default_options.linktype);
+
QString linkname = "unknown";
- if(capture_dev_user_linktype_find(device->name) != -1) {
- device->active_dlt = capture_dev_user_linktype_find(device->name);
- }
for (list = device->links; list != NULL; list = g_list_next(list)) {
linkr = (link_row*)(list->data);
if (linkr->dlt == device->active_dlt) {