netsampler / goflow2

High performance sFlow/IPFIX/NetFlow Collector
BSD 3-Clause "New" or "Revised" License
463 stars 110 forks source link

Fix.listen ipv6 #321

Closed newgenid closed 1 month ago

newgenid commented 4 months ago

Hello.

fmt.Sprintf("%s:%d", addr, port) works incorrect for ipv6 addr. For example, if addr = "::", port = 444, this code returns ":::444". The ":::444" is incorrect address for using in reuseport.ListenPacket().

net.JoinHostPort() supports ipv6 addresses and returns "[host]:port".

Without this fix UDPReceiver does not work with ipv6 addresses.

Thank you.

lspgn commented 4 months ago

Thank you for the details I could have reopened #316 but will move forward with this one once I check it

lspgn commented 4 months ago

Ok I dived into the code. Would be great to also add ways to break the application. Ended up finding a different bug and was fearing a regression.

lspgn commented 1 month ago

Should be fixed with #323

newgenid commented 1 month ago

Thank you.