Closed netixx closed 10 months ago
Looks like the bytes are store in index 12,13,14 and 15:
func ipv4AddrToArray(x net.IP) [4]byte {
return [4]byte{
x[12], x[13], x[14], x[15],
}
}
at least in go1.21 (source net/ip.go).
Thanks for the detailed bug report!
I'll provide a fix asap :)
Thanks for the quick work!! Honestly I thought there would be better way to convert (in the sdtlib), but I didn't find any!! Maybe the new netip package has something...
Just to mention: I think the function should be fine for ipv6, but I didn't test it!
Describe the bug A clear and concise description of what the bug is.
Steps to Reproduce in cmd/bio-rd/main.go, configure a bind IP for
Expected behavior The program should bind the socket on the provided IP address.
Configuration used
Additional context By modifying the code in net/tcp/listen.go the following way:
I was able to produce the following output:
As you can see the bind call is 0.0.0.0 beccause ipv4AddrToArray returns [0 0 0 0].