Skip to content

Find, verify, and analyze leaked credentials

1833 Fix syslog udp (#1835)

David24a09bc37d6b
diff --git a/pkg/sources/syslog/syslog.go b/pkg/sources/syslog/syslog.go
index be804d9d6..48b607edd 100644
--- a/pkg/sources/syslog/syslog.go
+++ b/pkg/sources/syslog/syslog.go
@@ -303,6 +303,10 @@ func (s *Source) acceptUDPConnections(ctx context.Context, netListener net.Packe
if common.IsDone(ctx) {
return nil
}
+ err := netListener.SetDeadline(time.Now().Add(time.Second))
+ if err != nil {
+ ctx.Logger().V(2).Info("could not update connection deadline", "error", err)
+ }
input := make([]byte, 65535)
_, remote, err := netListener.ReadFrom(input)
if err != nil {