On Tuesday, 18 November 2025 at 12:56:08 UTC Zhang Jie (Kn) wrote:
I don't know if the kernel bug really exists, or is it caused by some
virtualization technology bugs.
If it exists, it's a bug in the guest kernel. The outer virtualization
layer has no knowledge or visibility of socket data structures in the guest
kernel.
> In golang, net.ListenTCP will set REUSEADDR to quickly reuse the same
ipport, but listen twice shouldn't success unless REUSEPORT set.
I found this in the go source:
func setDefaultListenerSockopts(s int) error {
// Allow reuse of recently-used addresses.
return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(s,
syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1))
}
If that's used on sockets by default, then yes this condition could quite
possibly happen.
If you want to report this as a bug, try making a small piece of standalone
Go code which reproduces the issue with what you're trying to do.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/c14147f2-b874-44bf-94f4-be0e2c77e40fn%40googlegroups.com.