allow unknown record structures in sFlow (#153)

This commit is contained in:
Louis
2023-04-16 06:59:53 +03:00
committed by GitHub
parent c4c4ffb4e4
commit 9850000ffa
2 changed files with 13 additions and 2 deletions

View File

@@ -247,7 +247,10 @@ func DecodeFlowRecord(header *RecordHeader, payload *bytes.Buffer) (FlowRecord,
flowRecord.Data = extendedGateway
default:
return flowRecord, errors.New(fmt.Sprintf("Unknown data format %v.", (*header).DataFormat))
//return flowRecord, errors.New(fmt.Sprintf("Unknown data format %v.", (*header).DataFormat))
flowRecord.Data = &FlowRecordRaw{
Data: payload.Next(int(header.Length)),
}
}
return flowRecord, nil
}