luci-app-mosdns/mosdns/patches/104-fixed-712.patch
2023-09-18 14:59:04 +08:00

47 lines
1.2 KiB
Diff

From 757ccd6692c93fd7071a9e8011beea3d792dfb9d Mon Sep 17 00:00:00 2001
From: Irine Sistiana <49315432+IrineSistiana@users.noreply.github.com>
Date: Sun, 17 Sep 2023 19:52:38 +0800
Subject: [PATCH 05/10] fixed #712
---
plugin/executable/nftset/nftset_linux.go | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/plugin/executable/nftset/nftset_linux.go b/plugin/executable/nftset/nftset_linux.go
index 5d6b0ec..0fc1c8e 100644
--- a/plugin/executable/nftset/nftset_linux.go
+++ b/plugin/executable/nftset/nftset_linux.go
@@ -24,12 +24,13 @@ package nftset
import (
"context"
"fmt"
+ "net/netip"
+
"github.com/IrineSistiana/mosdns/v5/pkg/nftset_utils"
"github.com/IrineSistiana/mosdns/v5/pkg/query_context"
"github.com/IrineSistiana/mosdns/v5/pkg/utils"
"github.com/google/nftables"
"github.com/miekg/dns"
- "net/netip"
)
type nftSetPlugin struct {
@@ -138,8 +139,12 @@ func (p *nftSetPlugin) addElems(r *dns.Msg) error {
}
func (p *nftSetPlugin) Close() error {
- _ = p.v6Handler.Close()
- _ = p.v4Handler.Close()
+ if p.v4Handler != nil {
+ _ = p.v4Handler.Close()
+ }
+ if p.v6Handler != nil {
+ _ = p.v6Handler.Close()
+ }
return nil
}
--
2.34.8