Client "failed to dial: invalid argument" on s390x big-endian architecture
Closed this issue · 2 comments
Hi there,
I am trying to build Calico on s390x architecture which uses this package for SCTP related logic. I noticed that client would not connect to server spitting out following message:
/tmp/gotest/sctp/example# ./example -port 1000 -ip localhost
2021/05/04 08:04:41 Resolved address 'localhost' to 127.0.0.1
2021/05/04 08:04:41 raw addr: [0 2 3 232 127 0 0 1 0 0 0 0 0 0 0 0]
2021/05/04 08:04:41 failed to dial: invalid argument
Upon debugging I found that SCTP_SOCKOPT_CONNECTX3
flag used here caused the issue. When I replaced the flag with SCTP_SOCKOPT_CONNECTX
then it works fine.
I am using go version go1.15.2 linux/s390x
to compile/run the example included in the repository.
Just wondering what would cause this issue and whether SCTP_SOCKOPT_CONNECTX
can be used exclusively during SCTPConnect
function?
Thanks!
Some more update: I noticed that by only changing optlen to uintptr(unsafe.Pointer(&optlen))
makes it work across most of s390x distros. It certainly looks like getsockopt
function is having trouble passing the optlen
arguments. Wonder if there are other ways of achieving similar results?
Closing - N/A.