From 99e086f684dfad5243202b0d9ded8d4f73fa0712 Mon Sep 17 00:00:00 2001 From: lspgn Date: Sat, 2 Apr 2022 10:40:35 -0700 Subject: [PATCH] support netflow v9 variable length --- decoders/netflow/netflow.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decoders/netflow/netflow.go b/decoders/netflow/netflow.go index 460f22c..156dd00 100644 --- a/decoders/netflow/netflow.go +++ b/decoders/netflow/netflow.go @@ -145,7 +145,7 @@ func DecodeTemplateSet(version uint16, payload *bytes.Buffer) ([]TemplateRecord, func GetTemplateSize(version uint16, template []Field) int { sum := 0 for _, templateField := range template { - if version == 10 && templateField.Length == 0xffff { + if templateField.Length == 0xffff { continue } @@ -161,7 +161,7 @@ func DecodeDataSetUsingFields(version uint16, payload *bytes.Buffer, listFields for i, templateField := range listFields { finalLength := int(templateField.Length) - if version == 10 && templateField.Length == 0xffff { + if templateField.Length == 0xffff { var variableLen8 byte var variableLen16 uint16 err := utils.BinaryDecoder(payload, &variableLen8)