mosdns: update from upstream

This commit is contained in:
sbwml 2023-09-18 02:21:46 +08:00
parent e255e8fb98
commit c06a96ef13

View File

@ -0,0 +1,46 @@
From 208abee452a28674e521bc317fb901c4e7c2a7a9 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] 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