mirror of
https://github.com/openobserve/goflow2.git
synced 2025-11-02 04:53:27 +00:00
Bugfix NetFlow/IPFIX producer
* Source and destination mac addresses are fed from `NFV9_FIELD_xx_yyy_MAC` Fixes a bug where the samples were missing either source or destination Mac. This is supposed to be linked to the sampling direction.
This commit is contained in:
@@ -254,6 +254,10 @@ func ConvertNetFlowDataSet(version uint16, baseTime uint32, uptime uint32, recor
|
||||
// Mac
|
||||
case netflow.NFV9_FIELD_IN_SRC_MAC:
|
||||
DecodeUNumber(v, &(flowMessage.SrcMac))
|
||||
case netflow.NFV9_FIELD_IN_DST_MAC:
|
||||
DecodeUNumber(v, &(flowMessage.DstMac))
|
||||
case netflow.NFV9_FIELD_OUT_SRC_MAC:
|
||||
DecodeUNumber(v, &(flowMessage.SrcMac))
|
||||
case netflow.NFV9_FIELD_OUT_DST_MAC:
|
||||
DecodeUNumber(v, &(flowMessage.DstMac))
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ func TestDecodeFlowExpandedSFlow(t *testing.T) {
|
||||
Payload: getExpandedSFlowDecode(),
|
||||
}
|
||||
|
||||
s := &StateSFlow{
|
||||
}
|
||||
s := &StateSFlow{}
|
||||
|
||||
assert.Nil(t, s.DecodeFlow(msg))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user