Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flow Aggregator] Fix template ID error in IPFIX exporter #6630

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/flowaggregator/exporter/ipfix.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ func (e *IPFIXExporter) UpdateOptions(opt *options.Options) {
}

func (e *IPFIXExporter) sendRecord(record ipfixentities.Record, isRecordIPv6 bool) error {
templateID := e.templateIDv4
if isRecordIPv6 {
templateID = e.templateIDv6
}

if e.exportingProcess == nil {
if err := initIPFIXExportingProcess(e); err != nil {
// in case of error, the FlowAggregator flowExportLoop will retry after activeFlowRecordTimeout
return fmt.Errorf("error when initializing IPFIX exporting process: %v", err)
}
}

templateID := e.templateIDv4
if isRecordIPv6 {
templateID = e.templateIDv6
}

// TODO: more records per data set will be supported when go-ipfix supports size check when adding records
e.set.ResetSet()
if err := e.set.PrepareSet(ipfixentities.Data, templateID); err != nil {
Expand Down