1
0
mirror of https://github.com/netsampler/goflow2.git synced 2024-05-06 15:54:52 +00:00

Merge pull request #77 from netsampler/bug/netflowv9-variable

support netflow v9 variable length
This commit is contained in:
Louis
2022-04-28 20:53:15 -07:00
committed by GitHub

View File

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