From cd2e4ae80196bbf5bd53d8b51a191bab7df3778c Mon Sep 17 00:00:00 2001 From: Sauci Date: Thu, 26 Nov 2020 01:18:49 -0800 Subject: [PATCH] handle EAFNOSUPPORT error returned on AF_CAN --- unix/syscall_internal_linux_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unix/syscall_internal_linux_test.go b/unix/syscall_internal_linux_test.go index 75952c07..a7b53162 100644 --- a/unix/syscall_internal_linux_test.go +++ b/unix/syscall_internal_linux_test.go @@ -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) }