diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-05-11 03:56:44 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-05-11 10:57:22 +0000 |
commit | 79eab8ca070f978415126f85b0777ab4ab02f0a2 (patch) | |
tree | 2e525b1b6adee7397fb80362fc0016a76cb93b5e /ui | |
parent | 871a8a2cccf79fae30c30a99fa21a4fa4dfbae16 (diff) |
Force HAVE_REMOTE to be defined when including pcap.h with remote support.
WinPcap made the mistake of having stuff in its public header fines
depend on a configuration #define, HAVE_REMOTE; this means that we need
to forcibly define it when building with remote capture support.
The tip of the libpcap master branch does not have that botch; hopefully
future versions of libpcap-for-Windows will be based on that libpcap and
thus lack that botch as well.
Defining HAVE_REMOTE in config.h is not the right fix, as it makes it
look like a *Wireshark* configuration option that code in Wireshark
should test, rather than a *WinPcap* configuration option that the
pcap.h that ships with the WinPcap SDK should have been changed, as part
of the build process, to correctly define or not, so that users of
WinPcap don't have to define it themselves.
Change-Id: I62d1eca6d3c900d0dcc9fbc011db77f595a86313
Reviewed-on: https://code.wireshark.org/review/21593
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/airpcap_dlg.c | 12 | ||||
-rw-r--r-- | ui/qt/capture_filter_syntax_worker.cpp | 14 | ||||
-rw-r--r-- | ui/qt/compiled_filter_output.cpp | 12 |
3 files changed, 38 insertions, 0 deletions
diff --git a/ui/gtk/airpcap_dlg.c b/ui/gtk/airpcap_dlg.c index b3660b387f..b02034c2db 100644 --- a/ui/gtk/airpcap_dlg.c +++ b/ui/gtk/airpcap_dlg.c @@ -35,6 +35,18 @@ #include <epan/prefs.h> #include <epan/crypt/wep-wpadefs.h> +#ifdef HAVE_PCAP_REMOTE +/* + * Force the WinPcap header files to define things required for remote + * capture. (Yes, this is q WinPcap bug; if your project has a public + * header file that checks or otherwise uses a #define that's defined + * by your project's configuration process, and don't ensure that + * it's always defined appropriately when that header file is included, + * before its first use, you have made a mistake.) + */ +#define HAVE_REMOTE +#endif + #include <pcap.h> #include "ui/simple_dialog.h" diff --git a/ui/qt/capture_filter_syntax_worker.cpp b/ui/qt/capture_filter_syntax_worker.cpp index 9f6ae0cc1c..a296f89c51 100644 --- a/ui/qt/capture_filter_syntax_worker.cpp +++ b/ui/qt/capture_filter_syntax_worker.cpp @@ -23,7 +23,21 @@ #ifdef HAVE_LIBPCAP #include <glib.h> + +#ifdef HAVE_PCAP_REMOTE +/* + * Force the WinPcap header files to define things required for remote + * capture. (Yes, this is q WinPcap bug; if your project has a public + * header file that checks or otherwise uses a #define that's defined + * by your project's configuration process, and don't ensure that + * it's always defined appropriately when that header file is included, + * before its first use, you have made a mistake.) + */ +#define HAVE_REMOTE +#endif + #include <pcap.h> + #include "capture_opts.h" #include "ui/capture_globals.h" #endif diff --git a/ui/qt/compiled_filter_output.cpp b/ui/qt/compiled_filter_output.cpp index 67c5f64daa..c78ab713ac 100644 --- a/ui/qt/compiled_filter_output.cpp +++ b/ui/qt/compiled_filter_output.cpp @@ -23,6 +23,18 @@ #include <ui_compiled_filter_output.h> #include "compiled_filter_output.h" +#ifdef HAVE_PCAP_REMOTE +/* + * Force the WinPcap header files to define things required for remote + * capture. (Yes, this is q WinPcap bug; if your project has a public + * header file that checks or otherwise uses a #define that's defined + * by your project's configuration process, and don't ensure that + * it's always defined appropriately when that header file is included, + * before its first use, you have made a mistake.) + */ +#define HAVE_REMOTE +#endif + #include <pcap.h> #include "capture_opts.h" |