Summary: | HttpServletRequest.getRemoteHost() returning invalid results | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Gili <cowwoc> |
Component: | Connector:Coyote | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 5.5.12 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Gili
2006-01-02 17:38:00 UTC
BTW: I only use the HTTP connector, not jk or apr. This is a standalone Tomcat server. I went one step further and tried comparing the output of HttpServletRequest.getRemoteHost() and InetAddress.getHostname(): String remoteHost = request.getRemoteHost(); String ip = request.getRemoteAddr(); text.append("ip " + ip + " maps to " + remoteHost); String hostname = InetAddress.getByName(ip).getHostName(); if (!hostname.equals(remoteHost)) { text.append(" but the actual hostname is " + hostname); log.debug(text); } and got output like this: ip 210.111.94.102 maps to vz4-vlan1.networx-bg.com but the actual hostname is 210.111.94.102 doing "nslookup" locally I clearly see that 210.111.94.102 has no reverse lookup and that vz4-vlan1.networx-bg.com actually maps to 82.147.153.200 so now I'm 100% certain this is a Tomcat bug. Have you guys had a chance to look at this issue? Any idea what piece of code might be at fault? This should be fixed now in the SVN trunk, and should appear in 5.5.16. Reviewing the commit logs shows that this should have been there for a very long time (but shouldn't happen very often). |