diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-03-17 19:43:03 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-03-17 20:06:04 +0100 |
commit | 32896ab56d9ff767af9ed00cb5c9954edb0a2a81 (patch) | |
tree | ca54bc673e23bc8c74fb29cf70137c70c0d780b8 /pkg/tcpip | |
parent | 5b8da876daf5b06ae57e35d6af0180b752ae0c61 (diff) |
WIP debug
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/link/rawfile/rawfile_unsafe.go | 8 | ||||
-rw-r--r-- | pkg/tcpip/stack/stack.go | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/link/rawfile/rawfile_unsafe.go b/pkg/tcpip/link/rawfile/rawfile_unsafe.go index 44e25d475..cf49ce572 100644 --- a/pkg/tcpip/link/rawfile/rawfile_unsafe.go +++ b/pkg/tcpip/link/rawfile/rawfile_unsafe.go @@ -19,6 +19,9 @@ package rawfile import ( + "runtime/debug" + "fmt" + "log" "syscall" "unsafe" @@ -149,6 +152,11 @@ func BlockingReadv(fd int, iovecs []syscall.Iovec) (int, *tcpip.Error) { n, _, e := syscall.RawSyscall(syscall.SYS_READV, uintptr(fd), uintptr(unsafe.Pointer(&iovecs[0])), uintptr(len(iovecs))) if e == 0 { return int(n), nil + } else if e != syscall.EAGAIN && e != syscall.EWOULDBLOCK && e != syscall.EINTR { + fmt.Println("BlockingReadv: RawSyscall failed ", e) + debug.PrintStack() + log.Fatal("BlockingReadv: RawSyscall failed ", e) +// return 0, TranslateErrno(e) } event := PollEvent{ diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 5ffb7166f..68abdb43b 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -21,6 +21,7 @@ package stack import ( "encoding/binary" + "fmt" "sync/atomic" "time" @@ -615,6 +616,7 @@ func (*TransportEndpointInfo) IsEndpointInfo() {} // stack. Please refer to individual protocol implementations as to what options // are supported. func New(opts Options) *Stack { + fmt.Println("stack.New()") clock := opts.Clock if clock == nil { clock = &tcpip.StdClock{} |