Wireshark-dev: [Wireshark-dev] Why "Monitor Mode" column still showed "n/a" when pcap_can_set_r
Hi list,
I'm using Wireshark 2.1.0-3054-gad4d0b8. I found that after I made pcap_can_set_rfmon() function in Npcap always return 1. The Capture Interfaces window still shows "n/a" in "Monitor Mode" column.
J:\npcap\wpcap\libpcap\pcap.c:
/*
* Returns 1 if rfmon mode can be set on the pcap_t, 0 if it can't,
* a PCAP_ERROR value on an error.
*/
int
pcap_can_set_rfmon(pcap_t *p)
{
return 1;
//return (p->can_set_rfmon_op(p));
}
I have analyzed the code flow:
ti->setText(col_monitor_, QString(device->monitor_mode_supported? (device->monitor_mode_enabled ? tr("enabled") : tr("disabled")) : tr("n/a")));
The key is:
device->monitor_mode_supported
device.monitor_mode_supported = caps->can_set_rfmon;
The key is:
caps->can_set_rfmon
status = pcap_can_set_rfmon(pch);
The key is:
pcap_can_set_rfmon()
So this call sequence shows that if pcap_can_set_rfmon() returns 1, the "Monitor Mode" column should show "enabled" or "disabled", not "n/a". So what am I missing here?
Cheers,
Yang