aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-07-07 01:55:34 +0000
committerGuy Harris <guy@alum.mit.edu>2010-07-07 01:55:34 +0000
commitba77133cbb9730a5a760f354a9713fe1ef93da60 (patch)
tree4629084161b9ab0339693f51760b83a334b5789d /gtk/capture_dlg.c
parentf4bb9209ae408b74e0d80cf2105696b830994b4f (diff)
I added PCAP_NETMASK_UNKNOWN in libpcap 1.1.0; it's not present in
1.0.0. You're supposed to just use 0 in releases prior to 1.1.0 - in 1.1.0 and later, a netmask of PCAP_NETMASK_UNKNOWN will cause errors if you try to use "ip broadcast" (as you need the netmask to check for local broadcasts), but, prior to that, the netmask value is blindly used even if the filter will always fail. svn path=/trunk/; revision=33461
Diffstat (limited to 'gtk/capture_dlg.c')
-rw-r--r--gtk/capture_dlg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c
index 78030bb597..000e4d87a0 100644
--- a/gtk/capture_dlg.c
+++ b/gtk/capture_dlg.c
@@ -1508,7 +1508,11 @@ capture_filter_compile_cb(GtkWidget *w _U_, gpointer user_data _U_)
filter_te = GTK_COMBO(filter_cm)->entry;
filter_text = gtk_entry_get_text(GTK_ENTRY(filter_te));
+#ifdef PCAP_NETMASK_UNKNOWN
if (pcap_compile(pd, &fcode, filter_text, 1 /* Do optimize */, PCAP_NETMASK_UNKNOWN) < 0) {
+#else
+ if (pcap_compile(pd, &fcode, filter_text, 1 /* Do optimize */, 0) < 0) {
+#endif
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", pcap_geterr(pd));
} else {
GString *bpf_code_dump = g_string_new("");