if (PacketSetHwFilter(pw->adapter,NDIS_PACKET_TYPE_PROMISCUOUS) == FALSE)
{
- pcap_fmt_errmsg_for_win32_err(p->errbuf,
- PCAP_ERRBUF_SIZE, GetLastError(),
- "failed to set hardware filter to promiscuous mode");
- goto bad;
+ DWORD errcode = GetLastError();
+
+ /*
+ * Suppress spurious error generated by non-compiant
+ * MS Surface mobile adapters.
+ *
+ * If we knew that this meant "promiscuous mode
+ * isn't supported", we could add a "promiscuous
+ * mode isn't supported" error code and return
+ * that, but:
+ *
+ * 1) we don't know that it means that
+ * rather than meaning "we reject attempts
+ * to set the filter, even though the NDIS
+ * specifications say you shouldn't do that"
+ *
+ * and
+ *
+ * 2) other interface types that don't
+ * support promiscuous mode, at least
+ * on UN*Xes, just silently ignore
+ * attempts to set promiscuous mode
+ *
+ * and rejecting it with an error could disrupt
+ * attempts to capture, as many programs (tcpdump,
+ * *shark) default to promiscuous mode.
+ */
+ if (errcode != NPF_SURFACE_MOBILE_NONPROMISC)
+ {
+ pcap_fmt_errmsg_for_win32_err(p->errbuf,
+ PCAP_ERRBUF_SIZE, errcode,
+ "failed to set hardware filter to promiscuous mode");
+ goto bad;
+ }
}
}
else
/*
* Suppress spurious error generated by non-compiant
- * MS Surface mobile adaptors
+ * MS Surface mobile adapters.
*/
if (errcode != NPF_SURFACE_MOBILE_NONPROMISC)
{