Make reverse dns lookups honor tombstones.

This commit is contained in:
Tom Wilkie committed 2015-08-25 12:01:09 +00:00
1 parent db2e7e4ba1
commit 46363f4129
2 files changed
+19 -1

No files matched your search

+1 -1
View File
@@ -121,7 +121,7 @@ func (n *Nameserver) ReverseLookup(ip address.Address) (string, error) {
defer n.RUnlock()
match, err := n.entries.first(func(e *Entry) bool {
return e.Addr == ip
return e.Tombstone == 0 && e.Addr == ip
})
if err != nil {
return "", err
+18
View File
@@ -0,0 +1,18 @@
#! /bin/bash
. ./config.sh
IP=10.2.0.67
start_suite "Reverse DNS test"
weave_on $HOST1 launch
start_container_with_dns $HOST1 --name=c1
for name in bar bar black sheep have you any wool; do
start_container $HOST1 $IP/24 --name=$name
assert "exec_on $HOST1 c1 dig +short -x $IP" $name.weave.local.
rm_containers $HOST1 $name
done
end_suite