Skip to content

Commit

Permalink
support netflow v9 variable length
Browse files Browse the repository at this point in the history
  • Loading branch information
lspgn committed Apr 2, 2022
1 parent 58f0f97 commit 99e086f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions decoders/netflow/netflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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)
Expand Down

0 comments on commit 99e086f

Please sign in to comment.