aboutsummaryrefslogtreecommitdiff
path: root/pcap-npf.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-05-30 15:47:16 -0700
committerGuy Harris <gharris@sonic.net>2020-05-30 15:47:16 -0700
commit19e1676ca47ddb11385b771f477e181e3a442e3b (patch)
tree433e6ab5b3ef2e106163cb780d2e84c202ac44f6 /pcap-npf.c
parentb1d0216d9c0eb2427559789383134d92a5ac6b76 (diff)
npf, airpcap: fill in ps_capt iff _WIN32 is defined.
struct pcap_stat has a ps_capt member iff _WIN32 is defined, so fill in our structure's ps_capt member iff _WIN32 is defined. (We *never* fill it in for pcap_stat(), as we cannot guarantee, *even on Windows*, that a structure passed to us will have them; we fill in a structure that *we* set up for pcap_next_ex(), so we don't have to worry about that.)
Diffstat (limited to 'pcap-npf.c')
-rw-r--r--pcap-npf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pcap-npf.c b/pcap-npf.c
index e3a995a2..688b21f7 100644
--- a/pcap-npf.c
+++ b/pcap-npf.c
@@ -273,7 +273,12 @@ pcap_stats_ex_npf(pcap_t *p, int *pcap_stat_size)
p->stat.ps_recv = bstats.bs_recv;
p->stat.ps_drop = bstats.bs_drop;
p->stat.ps_ifdrop = bstats.ps_ifdrop;
-#ifdef ENABLE_REMOTE
+ /*
+ * Just in case this is ever compiled for a target other than
+ * Windows, which is somewhere between extemely unlikely and
+ * impossible.
+ */
+#ifdef _WIN32
p->stat.ps_capt = bstats.bs_capt;
#endif
return (&p->stat);