Merge pull request #2818 from 'tobowers-fix-reverse-dns'
Lowercase the request before comparing it Fix #2817
This commit is contained in:
commit
9db22c3cd6
2 files changed
+8
-1
No files matched your search
+1
-1
@@ -222,7 +222,7 @@ func (h *handler) handleReverse(w dns.ResponseWriter, req *dns.Msg) {
|
||||
return
|
||||
}
|
||||
|
||||
ipStr := strings.TrimSuffix(req.Question[0].Name, "."+reverseDNSdomain)
|
||||
ipStr := strings.TrimSuffix(strings.ToLower(req.Question[0].Name), "."+reverseDNSdomain)
|
||||
ip, err := address.ParseIP(ipStr)
|
||||
if err != nil {
|
||||
h.nameError(w, req)
|
||||
|
||||
@@ -6,6 +6,9 @@ C1=10.2.0.78
|
||||
C2=10.2.0.79
|
||||
C3=10.2.0.80
|
||||
|
||||
REVERSE_C1_LOWER=78.0.2.10.in-addr.arpa
|
||||
REVERSE_C1_UPPER=78.0.2.10.IN-ADDR.ARPA
|
||||
|
||||
start_suite "DNS lookup case (in)sensitivity"
|
||||
|
||||
weave_on $HOST1 launch
|
||||
@@ -17,6 +20,10 @@ assert_dns_record $HOST1 test seeone.weave.local $C1
|
||||
assert_dns_record $HOST1 test SeeOne.weave.local $C1
|
||||
assert_dns_record $HOST1 test SEEONE.weave.local $C1
|
||||
|
||||
# Test reverse DNS using explicit in-addr.arpa format, lower and upper case
|
||||
assert "exec_on $HOST1 test dig +short -t PTR $REVERSE_C1_LOWER" seeone.weave.local.
|
||||
assert "exec_on $HOST1 test dig +short -t PTR $REVERSE_C1_UPPER" seeone.weave.local.
|
||||
|
||||
start_container $HOST1 $C2/24 --name=SeEtWo
|
||||
assert_dns_record $HOST1 test seetwo.weave.local $C2
|
||||
assert_dns_record $HOST1 test SeeTwo.weave.local $C2
|
||||
|
||||
Reference in new issue
Block a user