Skip to content

Commit 0e3f5ea

Browse files
author
Mario Macias
authored
Revert "NETOBSERV-755: ignore flow direction in deduplication (#74)" (#77)
This reverts commit 7c2b292.
1 parent 7c2b292 commit 0e3f5ea

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/flow/deduper.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ func (c *deduperCache) isDupe(key *RecordKey) bool {
6767
// zeroes fields from key that should be ignored from the flow comparison
6868
rk.IFIndex = 0
6969
rk.DataLink = DataLink{}
70-
rk.Direction = 0
7170
// If a flow has been accounted previously, whatever its interface was,
7271
// it updates the expiry time for that flow
7372
if ele, ok := c.ifaces[rk]; ok {

pkg/flow/deduper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ var (
2121
}, RecordMetrics: RecordMetrics{
2222
Packets: 2, Bytes: 456,
2323
}}, Interface: "123456789"}
24-
// another fow from 2 different interfaces and directions
24+
// another fow from 2 different interfaces
2525
twoIf1 = &Record{RawRecord: RawRecord{RecordKey: RecordKey{
2626
EthProtocol: 1, Direction: 1, Transport: Transport{SrcPort: 333, DstPort: 456},
2727
DataLink: DataLink{DstMac: MacAddr{0x1}, SrcMac: MacAddr{0x1}}, IFIndex: 1,
2828
}, RecordMetrics: RecordMetrics{
2929
Packets: 2, Bytes: 456,
3030
}}, Interface: "eth0"}
3131
twoIf2 = &Record{RawRecord: RawRecord{RecordKey: RecordKey{
32-
EthProtocol: 1, Direction: 0, Transport: Transport{SrcPort: 333, DstPort: 456},
32+
EthProtocol: 1, Direction: 1, Transport: Transport{SrcPort: 333, DstPort: 456},
3333
DataLink: DataLink{DstMac: MacAddr{0x2}, SrcMac: MacAddr{0x2}}, IFIndex: 2,
3434
}, RecordMetrics: RecordMetrics{
3535
Packets: 2, Bytes: 456,

0 commit comments

Comments
 (0)