mirror of
https://github.com/safing/portmaster
synced 2025-04-25 13:29:10 +00:00
Fix slow nfq shutdown
This commit is contained in:
parent
18cc0f2bf6
commit
684555e5e5
3 changed files with 14 additions and 5 deletions
6
Gopkg.lock
generated
6
Gopkg.lock
generated
|
@ -140,15 +140,15 @@
|
|||
revision = "2bc1f35cddc0cc527b4bc3dce8578fc2a6c11384"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:1f6a000c4fe2eaf76f506ecc23e859e1a5b81c0ec3039c5fca21bfbb80c43979"
|
||||
digest = "1:711ec17a2d8edd94cff8e2e4339d847e46acc1bb6b49ec29dcc1db78b666378b"
|
||||
name = "github.com/mdlayher/netlink"
|
||||
packages = [
|
||||
".",
|
||||
"nlenc",
|
||||
]
|
||||
pruneopts = ""
|
||||
revision = "ded538f7f4be5ec9a64b7a16c7fdb0bc66bfb85b"
|
||||
revision = "2a4e26491f1ba4eae173a7733ac11744cfed82b5"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:508f444b8e00a569a40899aaf5740348b44c305d36f36d4f002b277677deef95"
|
||||
|
|
|
@ -32,4 +32,4 @@ ignored = ["github.com/safing/portbase/*", "github.com/safing/spn/*"]
|
|||
|
||||
[[override]]
|
||||
name = "github.com/mdlayher/netlink"
|
||||
branch = "master" # remove when https://github.com/mdlayher/netlink/pull/171 is released and in github.com/florianl/go-nfqueue
|
||||
version = "1.2.0" # remove when github.com/florianl/go-nfqueue has updated to v1.2.0
|
||||
|
|
|
@ -6,6 +6,7 @@ package nfq
|
|||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
|
@ -140,7 +141,15 @@ func (q *Queue) handleError(e error) int {
|
|||
return 0
|
||||
}
|
||||
}
|
||||
log.Errorf("nfqueue: encountered error while receiving packets: %s\n", e.Error())
|
||||
|
||||
// Check if the queue was already closed. Unfortunately, the exposed error
|
||||
// variable is in an internal stdlib package. Therefore, check for the error
|
||||
// string instead. :(
|
||||
// Offical error variable is defined here:
|
||||
// https://github.com/golang/go/blob/0e85fd7561de869add933801c531bf25dee9561c/src/internal/poll/fd.go#L24
|
||||
if !strings.HasSuffix(e.Error(), "use of closed file") {
|
||||
log.Errorf("nfqueue: encountered error while receiving packets: %s\n", e.Error())
|
||||
}
|
||||
|
||||
// Close the existing socket
|
||||
if nf := q.getNfq(); nf != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue