Browse Source

Strip away an infra.ffpb or srv.infra.ffpb suffix when resolving IP.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm 9 years ago
parent
commit
3f9f218e34
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/ffpb.py

+ 2 - 2
modules/ffpb.py

@@ -68,7 +68,7 @@ class MsgHandler(SocketServer.BaseRequestHandler):
     def resolve_name(self, ipaddr):
         """
         Resolves the host name of the given IP address
-        and strips away the suffix (.infra)?.ffpb
+        and strips away the suffix ((.srv)?.infra)?.ffpb
         """
 
         if ipaddr.startswith("127."):
@@ -76,7 +76,7 @@ class MsgHandler(SocketServer.BaseRequestHandler):
 
         try:
             addr = dns.reversename.from_address(ipaddr)
-            return re.sub("(.infra)?.ffpb.", "", str(ffpb_resolver.query(addr, "PTR")[0]))
+            return re.sub("((.srv)?.infra)?.ffpb.", "", str(ffpb_resolver.query(addr, "PTR")[0]))
         except dns.resolver.NXDOMAIN:
             return ipaddr