1
0
mirror of https://github.com/netsampler/goflow2.git synced 2024-05-06 15:54:52 +00:00

Silently drop 0 byte packets without processing as flow (#114)

Co-authored-by: Ian Pye <pye@kentik.com>
This commit is contained in:
Ian
2022-08-17 20:01:02 -07:00
committed by GitHub
parent 29075b832d
commit fc42020d1b

View File

@ -166,6 +166,9 @@ func UDPStoppableRoutine(stopCh <-chan struct{}, name string, decodeFunc decoder
u := udpData{}
u.size, u.pktAddr, _ = udpconn.ReadFromUDP(payload)
if stopped.Load() == false {
if u.size == 0 { // Ignore 0 byte packets.
continue
}
u.payload = make([]byte, u.size)
copy(u.payload, payload[0:u.size])
udpDataCh <- u