diff options
author | Guy Harris <gharris@sonic.net> | 2023-01-10 00:24:10 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2023-01-10 00:24:10 -0800 |
commit | 88926013e35cd3999c9cdd029c491c535496d261 (patch) | |
tree | 3eb3c1f24e20fe0c643c9710377905df5a5591fc /pcap-npf.c | |
parent | b98941d35b20b01a1de58701a194bda6077d4914 (diff) |
NPF: fix build, update comments.
The MS Surface Pro's mobile broadband driver appears to be returning
NDIS_STATUS_NOT_SUPPORTED for all attempts to set the hardware filter,
whether promiscuous mode is on or off. Update the comments to reflect
that, and fix a remaining check against NPF_SURFACE_MOBILE_NONPROMISC.
Diffstat (limited to 'pcap-npf.c')
-rw-r--r-- | pcap-npf.c | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -1003,16 +1003,10 @@ pcap_breakloop_npf(pcap_t *p) * * but I don't know why the goal was to avoid that translation. * - * Attempting to set non-promiscuous mode on a Microsoft Surface Pro's + * Attempting to set the hardware filter on a Microsoft Surface Pro's * Mobile Broadband Adapter returns an error that appears to be * NDIS_STATUS_NOT_SUPPORTED ORed with the "Customer" bit, so it's - * probably indicating that it doesn't support promiscuous mode, - * as one might expect, given that it's not going to promiscuously - * snoop for arbitrary mobile telecom network packets. That error can - * safely be ignored, as it's always in non-promiscuous mode; an - * alternative would be to report the PCAP_WARNING_PROMISC_NOTSUP - * warning, which indicates that the activate call succeeded but - * that something happened that the user might want to know about. + * probably indicating that it doesn't support that. * * It is likely that there are other devices which throw spurious errors, * at which point this will need refactoring to efficiently check against @@ -1310,14 +1304,13 @@ pcap_activate_npf(pcap_t *p) /* * Suppress spurious error generated by non-compiant - * MS Surface mobile adapters. + * MS Surface mobile adapters that appear to + * return NDIS_STATUS_NOT_SUPPORTED for attempts + * to set the hardware filter. * - * It appears to be reporting STATUS_NOT_SUPPORTED - * (ndis.h defines NDIS_STATUS_NOT_SUPPORTED to - * have the same value as the NT status value - * STATUS_NOT_SUPPORTED), but with the NT status - * value "Customer" bit set, probably by the - * Npcap NPF driver. + * It appears to be reporting NDIS_STATUS_NOT_SUPPORTED, + * but with the NT status value "Customer" bit set; + * the Npcap NPF driver sets that bit in some cases. * * If we knew that this meant "promiscuous mode * isn't supported", we could add a "promiscuous @@ -1380,7 +1373,7 @@ pcap_activate_npf(pcap_t *p) * Suppress spurious error generated by non-compiant * MS Surface mobile adapters. */ - if (errcode != NPF_SURFACE_MOBILE_NONPROMISC) + if (errcode != (NDIS_STATUS_NOT_SUPPORTED|NT_STATUS_CUSTOMER_DEFINED)) { pcap_fmt_errmsg_for_win32_err(p->errbuf, PCAP_ERRBUF_SIZE, errcode, |