$OpenBSD: patch-ui_qt_capture_filter_syntax_worker_cpp,v 1.4 2017/08/30 12:42:34 sthen Exp $

cope with old libpcap

Index: ui/qt/capture_filter_syntax_worker.cpp
--- ui/qt/capture_filter_syntax_worker.cpp.orig
+++ ui/qt/capture_filter_syntax_worker.cpp
@@ -96,11 +96,14 @@ void CaptureFilterSyntaxWorker::start() {
 #ifdef HAVE_EXTCAP
                 if (device.if_info.extcap == NULL || strlen(device.if_info.extcap) == 0) {
 #endif
+#ifdef DLT_USER0
                     if (device.active_dlt >= DLT_USER0 && device.active_dlt <= DLT_USER15) {
                         // Capture filter for DLT_USER is unknown
                         state = SyntaxLineEdit::Deprecated;
                         err_str = "Unable to check capture filter";
-                    } else {
+                    } else
+#endif
+                    {
                         active_dlts.insert(device.active_dlt);
                     }
 #ifdef HAVE_EXTCAP
@@ -122,7 +125,7 @@ void CaptureFilterSyntaxWorker::start() {
 #ifdef PCAP_NETMASK_UNKNOWN
             pc_err = pcap_compile(pd, &fcode, filter.toUtf8().constData(), 1 /* Do optimize */, PCAP_NETMASK_UNKNOWN);
 #else
-            pc_err = pcap_compile(pd, &fcode, filter.toUtf8().constData(), 1 /* Do optimize */, 0);
+            pc_err = pcap_compile(pd, &fcode, (char *)filter.toUtf8().constData(), 1 /* Do optimize */, 0);
 #endif
 
 #if DEBUG_SLEEP_TIME > 0
