Skip to content
Snippets Groups Projects
Unverified Commit c9c94502 authored by Joel Takvorian's avatar Joel Takvorian Committed by GitHub
Browse files

Merge pull request #79 from jotak/revert-revert

Revert "Revert "NETOBSERV-755: ignore flow direction in deduplication…
parents 4a0bd67d 17c0bf11
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,7 @@ func (c *deduperCache) isDupe(key *RecordKey) bool {
// zeroes fields from key that should be ignored from the flow comparison
rk.IFIndex = 0
rk.DataLink = DataLink{}
rk.Direction = 0
// If a flow has been accounted previously, whatever its interface was,
// it updates the expiry time for that flow
if ele, ok := c.ifaces[rk]; ok {
......
......@@ -21,7 +21,7 @@ var (
}, RecordMetrics: RecordMetrics{
Packets: 2, Bytes: 456,
}}, Interface: "123456789"}
// another fow from 2 different interfaces
// another fow from 2 different interfaces and directions
twoIf1 = &Record{RawRecord: RawRecord{RecordKey: RecordKey{
EthProtocol: 1, Direction: 1, Transport: Transport{SrcPort: 333, DstPort: 456},
DataLink: DataLink{DstMac: MacAddr{0x1}, SrcMac: MacAddr{0x1}}, IFIndex: 1,
......@@ -29,7 +29,7 @@ var (
Packets: 2, Bytes: 456,
}}, Interface: "eth0"}
twoIf2 = &Record{RawRecord: RawRecord{RecordKey: RecordKey{
EthProtocol: 1, Direction: 1, Transport: Transport{SrcPort: 333, DstPort: 456},
EthProtocol: 1, Direction: 0, Transport: Transport{SrcPort: 333, DstPort: 456},
DataLink: DataLink{DstMac: MacAddr{0x2}, SrcMac: MacAddr{0x2}}, IFIndex: 2,
}, RecordMetrics: RecordMetrics{
Packets: 2, Bytes: 456,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment