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:
lspgn
2021-06-09 18:08:55 -07:00
parent 622c41a69d
commit 04c8543306
2 changed files with 5 additions and 2 deletions

View File

@@ -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))

View File

@@ -12,8 +12,7 @@ func TestDecodeFlowExpandedSFlow(t *testing.T) {
Payload: getExpandedSFlowDecode(),
}
s := &StateSFlow{
}
s := &StateSFlow{}
assert.Nil(t, s.DecodeFlow(msg))
}