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:
@ -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
|
||||
|
Reference in New Issue
Block a user