From 7ca9893ca0f1e482a3667801f29e6239edfd0127 Mon Sep 17 00:00:00 2001 From: Vinit Chauhan Date: Mon, 21 Oct 2024 13:00:14 -0400 Subject: [PATCH] [Filebeat][udp] - Remove unnecessary multiplication (#41211) Remove unnecessary multiplication --------- Co-authored-by: Denis Co-authored-by: Kush Rana <89848966+kush-elastic@users.noreply.github.com> --- filebeat/inputsource/udp/server.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/filebeat/inputsource/udp/server.go b/filebeat/inputsource/udp/server.go index 75c74a1f3d0..3a0b429f851 100644 --- a/filebeat/inputsource/udp/server.go +++ b/filebeat/inputsource/udp/server.go @@ -20,8 +20,6 @@ package udp import ( "net" - "github.com/dustin/go-humanize" - "github.com/elastic/beats/v7/filebeat/inputsource" "github.com/elastic/beats/v7/filebeat/inputsource/common/dgram" "github.com/elastic/elastic-agent-libs/logp" @@ -62,12 +60,13 @@ func (u *Server) createConn() (net.PacketConn, error) { if err != nil { return nil, err } - socketSize := int(u.config.ReadBuffer) * humanize.KiByte - if socketSize != 0 { + + if int(u.config.ReadBuffer) != 0 { if err := listener.SetReadBuffer(int(u.config.ReadBuffer)); err != nil { return nil, err } } + u.localaddress = listener.LocalAddr().String() return listener, err