handle EAFNOSUPPORT error returned on AF_CAN

This commit is contained in:
Sauci
2020-11-26 01:18:49 -08:00
parent 23dbbe57aa
commit cd2e4ae801

View File

@@ -226,10 +226,12 @@ func Test_anyToSockaddr(t *testing.T) {
if tt.skt.domain != 0 {
fd, err = Socket(tt.skt.domain, tt.skt.typ, tt.skt.protocol)
// Some sockaddr types need specific kernel modules running: if these
// are not present we'll get EPROTONOSUPPORT back when trying to create
// the socket. Skip the test in this situation.
// are not present we'll get EPROTONOSUPPORT/EAFNOSUPPORT back when
// trying to create the socket. Skip the test in this situation.
if err == EPROTONOSUPPORT {
t.Skip("socket family/protocol not supported by kernel")
} else if err == EAFNOSUPPORT {
t.Skip("socket address family not supported by kernel")
} else if err != nil {
t.Fatalf("socket(%v): %v", tt.skt, err)
}