Skip to content

Commit

Permalink
Merge pull request #111 from nickbroon/fixes_while_debugging
Browse files Browse the repository at this point in the history
Correct indentation and braces so that it's readable
  • Loading branch information
ogasser authored Mar 23, 2018
2 parents b3b27e6 + 77f2ac4 commit aceda69
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/modules/ipfix/IpfixParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,19 +339,19 @@ uint32_t IpfixParser::processDataSet(boost::shared_ptr<IpfixRecord::SourceID> so
if (bt->recordLength < 65535) {
if (record + bt->recordLength > endOfSet) {
msg(LOG_ERR, "IpfixParser: Got a Data Set that contained not a single full record");
}
else
/* We stop processing when no full record is left */
while (record + bt->recordLength <= endOfSet) {
IpfixDataRecord* ipfixRecord = dataRecordIM.getNewInstance();
ipfixRecord->sourceID = sourceId;
ipfixRecord->templateInfo = ti;
ipfixRecord->dataLength = bt->recordLength;
ipfixRecord->message = message;
ipfixRecord->data = record;
push(ipfixRecord);
record = record + bt->recordLength;
numberOfRecords++;
} else {
/* We stop processing when no full record is left */
while (record + bt->recordLength <= endOfSet) {
IpfixDataRecord* ipfixRecord = dataRecordIM.getNewInstance();
ipfixRecord->sourceID = sourceId;
ipfixRecord->templateInfo = ti;
ipfixRecord->dataLength = bt->recordLength;
ipfixRecord->message = message;
ipfixRecord->data = record;
push(ipfixRecord);
record = record + bt->recordLength;
numberOfRecords++;
}
}
} else {
/* Variable-length record */
Expand Down Expand Up @@ -484,7 +484,7 @@ int IpfixParser::processNetflowV9Packet(boost::shared_array<uint8_t> message, ui
while (((numberOfDataRecords + numberOfTemplateRecords) <= expectedNumberOfRecords) && (((uint8_t*)(set) + 4) <= endOfMessage)) {
/* check set length */
if (ntohs(set->length) < 3) {
msg(LOG_ERR, "IpfixParser: Invalid set length %u, must be >= 4", ntohs(set->length));
msg(LOG_ERR, "IpfixParser: Invalid V9 set length %u, must be >= 4", ntohs(set->length));
return -1;
}

Expand Down Expand Up @@ -590,7 +590,7 @@ int IpfixParser::processIpfixPacket(boost::shared_array<uint8_t> message, uint16
while((uint8_t*)(set) + 4 <= endOfMessage) {
/* check set length */
if (ntohs(set->length) < 3) {
msg(LOG_ERR, "IpfixParser: Invalid set length %u, must be >= 4", ntohs(set->length));
msg(LOG_ERR, "IpfixParser: Invalid IPFIX set length %u, must be >= 4", ntohs(set->length));
return -1;
}

Expand Down

0 comments on commit aceda69

Please sign in to comment.