mirror of https://github.com/vishvananda/netlink
Revert "Change behavior of `Subscribe` to non-blocking. Fix test."
This reverts commit 916f9685fa
.
This commit is contained in:
parent
856e190dd7
commit
1e68b2710d
|
@ -367,9 +367,6 @@ func addrSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- AddrUpdate, done <-c
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
if cberr != nil {
|
||||
cberr(fmt.Errorf("Receive failed: %v",
|
||||
err))
|
||||
|
|
|
@ -2434,9 +2434,6 @@ func linkSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- LinkUpdate, done <-c
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
if cberr != nil {
|
||||
cberr(fmt.Errorf("Receive failed: %v",
|
||||
err))
|
||||
|
|
|
@ -416,9 +416,6 @@ func neighSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- NeighUpdate, done <
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
if cberr != nil {
|
||||
cberr(err)
|
||||
}
|
||||
|
|
|
@ -727,16 +727,6 @@ func Subscribe(protocol int, groups ...uint) (*NetlinkSocket, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Sometimes (socket_linux.go:SocketGet), Subscribe is used to create a socket
|
||||
// that subscirbed to no groups. So we don't need to set nonblock there.
|
||||
if len(groups) > 0 {
|
||||
if err := unix.SetNonblock(fd, true); err != nil {
|
||||
unix.Close(fd)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
s := &NetlinkSocket{
|
||||
fd: int32(fd),
|
||||
}
|
||||
|
|
|
@ -148,9 +148,6 @@ func ProcEventMonitor(ch chan<- ProcEvent, done <-chan struct{}, errorChan chan<
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
errorChan <- err
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1657,9 +1657,6 @@ func routeSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- RouteUpdate, done <
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
if cberr != nil {
|
||||
cberr(fmt.Errorf("Receive failed: %v",
|
||||
err))
|
||||
|
|
|
@ -499,9 +499,6 @@ loop:
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
if from.Pid != nl.PidKernel {
|
||||
|
|
|
@ -2,7 +2,6 @@ package netlink
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"syscall"
|
||||
|
||||
"github.com/vishvananda/netlink/nl"
|
||||
"github.com/vishvananda/netns"
|
||||
|
@ -57,9 +56,6 @@ func XfrmMonitor(ch chan<- XfrmMsg, done <-chan struct{}, errorChan chan<- error
|
|||
for {
|
||||
msgs, from, err := s.Receive()
|
||||
if err != nil {
|
||||
if err == syscall.EAGAIN {
|
||||
continue
|
||||
}
|
||||
errorChan <- err
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue