From e53c80a1fa5f704d2c54b87cbc190aaca5c40092 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Tue, 9 Jul 2024 11:34:17 -0700 Subject: [PATCH] drop reason desc fix --- pkg/plugin/windows/pktmon/pktmon_plugin_windows.go | 2 +- pkg/utils/common.go | 1 - pkg/utils/flow_utils.go | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/plugin/windows/pktmon/pktmon_plugin_windows.go b/pkg/plugin/windows/pktmon/pktmon_plugin_windows.go index 2b40a4493b..91da5df447 100644 --- a/pkg/plugin/windows/pktmon/pktmon_plugin_windows.go +++ b/pkg/plugin/windows/pktmon/pktmon_plugin_windows.go @@ -148,7 +148,7 @@ func (p *Plugin) Start(ctx context.Context) error { fl := event.GetFlow() if fl == nil { - p.l.Error("received nil flow") + p.l.Error("received nil flow, flow proto mismatch from client/server?") continue } diff --git a/pkg/utils/common.go b/pkg/utils/common.go index d5be149099..aef4de75aa 100644 --- a/pkg/utils/common.go +++ b/pkg/utils/common.go @@ -50,7 +50,6 @@ func Retry(f func() error, retry int) (err error) { return nil } t := int64(math.Pow(2, float64(i))) - fmt.Printf("failed with %v, retrying in %d seconds...\n", err, t) time.Sleep(time.Duration(t) * time.Second) } return err diff --git a/pkg/utils/flow_utils.go b/pkg/utils/flow_utils.go index d8e6736ec1..194ae3e9c4 100644 --- a/pkg/utils/flow_utils.go +++ b/pkg/utils/flow_utils.go @@ -286,11 +286,12 @@ func AddDropReason(f *flow.Flow, meta *RetinaMetadata, dropReason uint32) { // Retina drop reasons are different from the drop reasons available in flow library. // We map the ones available in flow library to the ones available in Retina. // Rest are set to UNKNOWN. The details are added in the metadata. + f.DropReasonDesc = GetDropReasonDesc(meta.GetDropReason()) + f.EventType = &flow.CiliumEventType{ Type: int32(api.MessageTypeDrop), SubType: int32(f.GetDropReasonDesc()), // This is the drop reason. } - f.DropReasonDesc = GetDropReasonDesc(meta.GetDropReason()) } func DropReasonDescription(f *flow.Flow) string {