summaryrefslogtreecommitdiff
path: root/vendor/github.com/miekg/dns/server.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-12-11 10:09:26 +0000
committerLibravatar GitHub <noreply@github.com>2023-12-11 10:09:26 +0000
commit9b03840b428838ed5a8cbabd0e38640f847edcbe (patch)
tree7d4c74b57b2b8761b93c16e38adbe3da21954c10 /vendor/github.com/miekg/dns/server.go
parent[chore]: Bump golang.org/x/oauth2 from 0.13.0 to 0.15.0 (#2438) (diff)
downloadgotosocial-9b03840b428838ed5a8cbabd0e38640f847edcbe.tar.xz
[chore]: Bump github.com/miekg/dns from 1.1.56 to 1.1.57 (#2439)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.56 to 1.1.57. - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.56...v1.1.57) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/miekg/dns/server.go')
-rw-r--r--vendor/github.com/miekg/dns/server.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/github.com/miekg/dns/server.go b/vendor/github.com/miekg/dns/server.go
index 64e388546..0207d6da2 100644
--- a/vendor/github.com/miekg/dns/server.go
+++ b/vendor/github.com/miekg/dns/server.go
@@ -226,6 +226,10 @@ type Server struct {
// Whether to set the SO_REUSEPORT socket option, allowing multiple listeners to be bound to a single address.
// It is only supported on certain GOOSes and when using ListenAndServe.
ReusePort bool
+ // Whether to set the SO_REUSEADDR socket option, allowing multiple listeners to be bound to a single address.
+ // Crucially this allows binding when an existing server is listening on `0.0.0.0` or `::`.
+ // It is only supported on certain GOOSes and when using ListenAndServe.
+ ReuseAddr bool
// AcceptMsgFunc will check the incoming message and will reject it early in the process.
// By default DefaultMsgAcceptFunc will be used.
MsgAcceptFunc MsgAcceptFunc
@@ -304,7 +308,7 @@ func (srv *Server) ListenAndServe() error {
switch srv.Net {
case "tcp", "tcp4", "tcp6":
- l, err := listenTCP(srv.Net, addr, srv.ReusePort)
+ l, err := listenTCP(srv.Net, addr, srv.ReusePort, srv.ReuseAddr)
if err != nil {
return err
}
@@ -317,7 +321,7 @@ func (srv *Server) ListenAndServe() error {
return errors.New("dns: neither Certificates nor GetCertificate set in Config")
}
network := strings.TrimSuffix(srv.Net, "-tls")
- l, err := listenTCP(network, addr, srv.ReusePort)
+ l, err := listenTCP(network, addr, srv.ReusePort, srv.ReuseAddr)
if err != nil {
return err
}
@@ -327,7 +331,7 @@ func (srv *Server) ListenAndServe() error {
unlock()
return srv.serveTCP(l)
case "udp", "udp4", "udp6":
- l, err := listenUDP(srv.Net, addr, srv.ReusePort)
+ l, err := listenUDP(srv.Net, addr, srv.ReusePort, srv.ReuseAddr)
if err != nil {
return err
}