blob: 963ed99655babede13a89b54134a1d1810a3a85f [file] [log] [blame]
David K. Bainbridge215e0242017-09-05 23:18:24 -07001// Copyright 2014 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
6
7package nettest
8
9import (
10 "os"
11 "syscall"
12)
13
14func protocolNotSupported(err error) bool {
15 switch err := err.(type) {
16 case syscall.Errno:
17 switch err {
18 case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT:
19 return true
20 }
21 case *os.SyscallError:
22 switch err := err.Err.(type) {
23 case syscall.Errno:
24 switch err {
25 case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT:
26 return true
27 }
28 }
29 }
30 return false
31}