aboutsummaryrefslogtreecommitdiff
path: root/plugin/backend_lookup.go
diff options
context:
space:
mode:
authorGravatar Yang Bo <oakyang@gmail.com> 2020-06-12 14:01:28 +0800
committerGravatar GitHub <noreply@github.com> 2020-06-12 06:01:28 +0000
commit4734c0db458550484486609cf1d2f22f7933349c (patch)
tree33c783f7569b294d985990c26592a70f3f86c9dc /plugin/backend_lookup.go
parent86df1282cb0a390a96b7960b7c43db8429c98003 (diff)
downloadcoredns-4734c0db458550484486609cf1d2f22f7933349c.tar.gz
coredns-4734c0db458550484486609cf1d2f22f7933349c.tar.zst
coredns-4734c0db458550484486609cf1d2f22f7933349c.zip
weight for SRV records should be at least 1 (#3931)
Automatically submitted.
Diffstat (limited to 'plugin/backend_lookup.go')
-rw-r--r--plugin/backend_lookup.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/backend_lookup.go b/plugin/backend_lookup.go
index c563295d6..9d7e366a3 100644
--- a/plugin/backend_lookup.go
+++ b/plugin/backend_lookup.go
@@ -185,6 +185,10 @@ func SRV(ctx context.Context, b ServiceBackend, zone string, state request.Reque
w1 *= float64(serv.Weight)
}
weight := uint16(math.Floor(w1))
+ // weight should be at least 1
+ if weight == 0 {
+ weight = 1
+ }
what, ip := serv.HostType()