Skip to content

Commit

Permalink
Merge pull request cloudflare#77 from netsampler/bug/netflowv9-variable
Browse files Browse the repository at this point in the history
support netflow v9 variable length
  • Loading branch information
lspgn authored Apr 29, 2022
2 parents 58f0f97 + 99e086f commit d59dad6
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 d59dad6

Please sign in to comment.