I've compiled naviserver on OpenBSD 4.0/sparc64.  What baffles me is
that [ns_conn peeraddr] always returns 0.0.0.0 for the client IP.  The
access.log also shows 0.0.0.0 as the source IP address.

For example:

0.0.0.0 - - [05/Feb/2007:19:08:16 -0700] "GET / HTTP/1.1" 200 865 ""
"Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7)
Gecko/20060911 Camino/1.0.3" 3.562137
0.0.0.0 - - [05/Feb/2007:20:45:37 -0700] "GET / HTTP/1.0" 200 865 ""
"Lynx/2.8.5rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7j" 4.294168

The first is from my powerbook; the second is from lynx (local to the box).

Just to rule out some completely screwed up tcp configuration I wrote
a small tclsh script.  When I point a browser to it tclsh knows the
real peer's address.

   proc accept {sock peer port} {after 1000 [list reply $sock]}

   proc reply {sock} {
       puts $sock "HTTP/1.0 200 OK"
       puts $sock "MIME-Version: 1.0"
       puts $sock "Content-Type: text/plain"
       puts $sock ""
       puts $sock [fconfigure $sock -peername]
       close $sock
   }

   socket -server accept -myaddr 0.0.0.0 80
   vwait forever

I get:

   67.172.241.159 c-67-172-241-159.hsd1.ut.comcast.net 64323
   127.0.0.1 localhost 4660

Any thoughts on why nsd doesn't see the real peer address?

Thanks,

Michael

Reply via email to