From 022fac534c7d8db2508eac72d3ca8a58153097b4 Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Sun, 31 May 2015 20:47:25 +0530 Subject: [PATCH] Feature (contd.): Variable Fields - fixed 2nd protocol of combo protocols not being listed and offset/mask not being calculated correctly for them via the GUI --- client/variablefieldswidget.cpp | 2 +- common/abstractprotocol.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/variablefieldswidget.cpp b/client/variablefieldswidget.cpp index b4f1ad5..56d2a7c 100644 --- a/client/variablefieldswidget.cpp +++ b/client/variablefieldswidget.cpp @@ -338,7 +338,7 @@ void VariableFieldsWidget::loadProtocolFields( field->clear(); field->addItem("Custom"); - for (int i = 0; i < protocol->frameFieldCount(); i++) { + for (int i = 0; i < protocol->fieldCount(); i++) { if (!protocol->fieldFlags(i).testFlag(AbstractProtocol::FrameField)) continue; QString name = protocol->fieldData(i, AbstractProtocol::FieldName) diff --git a/common/abstractprotocol.cpp b/common/abstractprotocol.cpp index d3583fa..40d8219 100644 --- a/common/abstractprotocol.cpp +++ b/common/abstractprotocol.cpp @@ -361,7 +361,8 @@ int AbstractProtocol::fieldFrameBitOffset(int index, int streamIndex) const { int ofs = 0; - if ((index < 0) || (index >= frameFieldCount())) + if ((index < 0) || (index >= fieldCount()) + || !fieldFlags(index).testFlag(FrameField)) return -1; // Lookup Cache; if not available calculate and cache (if enabled)