diff --git a/link_linux.go b/link_linux.go index 8801d8b6..e24614f1 100644 --- a/link_linux.go +++ b/link_linux.go @@ -2441,6 +2441,9 @@ func linkSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- LinkUpdate, done <-c continue } for _, m := range msgs { + if m.Header.Flags&unix.NLM_F_DUMP_INTR != 0 && cberr != nil { + cberr(ErrNlmFDumpIntr) + } if m.Header.Type == unix.NLMSG_DONE { continue } diff --git a/neigh_linux.go b/neigh_linux.go index 2ac17edf..0679fba8 100644 --- a/neigh_linux.go +++ b/neigh_linux.go @@ -429,6 +429,9 @@ func neighSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- NeighUpdate, done < continue } for _, m := range msgs { + if m.Header.Flags&unix.NLM_F_DUMP_INTR != 0 && cberr != nil { + cberr(ErrNlmFDumpIntr) + } if m.Header.Type == unix.NLMSG_DONE { if listExisting { // This will be called after handling AF_UNSPEC diff --git a/route_linux.go b/route_linux.go index 8c871350..87bbf7b1 100644 --- a/route_linux.go +++ b/route_linux.go @@ -1744,6 +1744,9 @@ func routeSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- RouteUpdate, done < continue } for _, m := range msgs { + if m.Header.Flags&unix.NLM_F_DUMP_INTR != 0 && cberr != nil { + cberr(ErrNlmFDumpIntr) + } if m.Header.Type == unix.NLMSG_DONE { continue } diff --git a/socket_xdp_linux.go b/socket_xdp_linux.go index 20c82f9c..7e957bfc 100644 --- a/socket_xdp_linux.go +++ b/socket_xdp_linux.go @@ -105,10 +105,10 @@ func SocketDiagXDP() ([]*XDPDiagInfoResp, error) { result = append(result, res) return nil }) - if err != nil { + if err != nil && !errors.Is(err, ErrNlmFDumpIntr) { return nil, err } - return result, nil + return result, err } // socketDiagXDPExecutor requests XDP_DIAG_INFO for XDP family sockets. @@ -128,6 +128,7 @@ func socketDiagXDPExecutor(receiver func(syscall.NetlinkMessage) error) error { return err } + dumpIntr := false loop: for { msgs, from, err := s.Receive() @@ -142,6 +143,9 @@ loop: } for _, m := range msgs { + if m.Header.Flags&unix.NLM_F_DUMP_INTR != 0 { + dumpIntr = true + } switch m.Header.Type { case unix.NLMSG_DONE: break loop @@ -154,6 +158,9 @@ loop: } } } + if dumpIntr { + return ErrNlmFDumpIntr + } return nil }