Revert "fix: engine exit when too many packets hit NFQUEUE"

This reverts commit bed34f94be.
This commit is contained in:
Haruue 2024-02-28 21:17:29 +08:00
parent 5d2d874089
commit bc8d15ef37
No known key found for this signature in database
GPG Key ID: F6083B28CBCBC148

View File

@ -12,7 +12,6 @@ import (
"github.com/coreos/go-iptables/iptables"
"github.com/florianl/go-nfqueue"
"github.com/mdlayher/netlink"
"golang.org/x/sys/unix"
)
const (
@ -153,12 +152,6 @@ func (n *nfqueuePacketIO) Register(ctx context.Context, cb PacketCallback) error
return okBoolToInt(cb(p, nil))
},
func(e error) int {
if opErr := (*netlink.OpError)(nil); errors.As(e, &opErr) {
if errors.Is(opErr.Err, unix.ENOBUFS) {
// Kernel buffer temporarily full, ignore
return 0
}
}
return okBoolToInt(cb(nil, e))
})
if err != nil {