fix bugs in BasicFlow.java and FlowGenerator.java #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bug 1: BasicFlow.java
In BasicFlow.java:firstPacket, the variable flowLengthStats is added
by payload of packet twice rather than once.
The first time is after enter BasicFlow.java:firstPacket, and before
checking whether it is forward packet or backward packet.
The second time is after checking whether it is forward packet or
backward packet.
bug 2: BasicFlow.java
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, the flags PSH and URG are counted
correctly.
But in the second and after packets of a flow which is handled in
BasicFlow.java:addPacket, the flags PSH and URG are not counted
correctly.
but 3: BasicFlow.java
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, when calling function:updateFlowBulk, the
BasicFlow.src is null, but the BasicFlow.src is used to compare with
the source ip of the first packet.
In function:updateFlowBulk, in order to compare with BasicFlow.src
and the source ip of the first packet, the code use operator ==
rather than Arrays.equals.
bug 4: FlowGenerator.java
When handling a closed flow which receives FIN flag, the code from
FlowGenerator.java:addPacket check if the flow receive FIN flag on
both direction, but the code incorrectly use
function:getBwdFINFlags + function:getBwdFINFlags == 2
rather than
function:getFwdFINFlags + function:getBwdFINFlags == 2.