goflow2 icon indicating copy to clipboard operation
goflow2 copied to clipboard

Fix.listen ipv6

Open newgenid opened this issue 1 year ago • 2 comments

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.

newgenid avatar May 17 '24 06:05 newgenid

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

lspgn avatar May 19 '24 04:05 lspgn

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.

  • it won't break passing a -listen sflow://locahost:6343
  • but there is no need to use the net function. It just checks if : are present
  • currently, the following -listen sflow://::1:6343 is not detected as a bad arguments to GoFlow2
    • the errors are not being intercepted properly

lspgn avatar May 19 '24 16:05 lspgn

Should be fixed with #323

lspgn avatar Aug 18 '24 00:08 lspgn

Thank you.

newgenid avatar Aug 24 '24 06:08 newgenid