Override RxStats filter if specified in drone.ini

This was added to work around any libpcap wrong BPF generation like #354 or
to workaround issues like #355 (stream stats with ICMPv6)
This commit is contained in:
Srivats P 2023-10-03 11:41:57 +05:30
parent 49cb7c40e0
commit f3f553d149
2 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "pcapextra.h"
#include "../common/debugdefs.h"
#include "../common/sign.h"
#include "settings.h"
#include "streamtiming.h"
#define Xnotify qWarning // FIXME
@ -80,7 +81,13 @@ void PcapRxStats::run()
")");
#endif
// Override filter expression if one is specified in .ini
if (appSettings->contains(kInternalRxStatsFilterKey))
capture_filter = appSettings->value(kInternalRxStatsFilterKey)
.toString();
qDebug("In %s", __PRETTY_FUNCTION__);
qDebug("RxStats Filter: %s", qPrintable(capture_filter));
handle_ = pcap_open_live(qPrintable(device_), 65535,
flags, 100 /* ms */, errbuf);

View File

@ -42,4 +42,8 @@ const QString kRpcServerAddress("RpcServer/Address");
const QString kPortListIncludeKey("PortList/Include");
const QString kPortListExcludeKey("PortList/Exclude");
//
// Internal Section Keys
//
const QString kInternalRxStatsFilterKey("Internal/RxStatsFilter");
#endif