From ba77133cbb9730a5a760f354a9713fe1ef93da60 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 7 Jul 2010 01:55:34 +0000 Subject: 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 --- gtk/capture_dlg.c | 4 ++++ 1 file changed, 4 insertions(+) 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(""); -- cgit v1.2.3