Solaris, NAT and remote address names
I have my server running on Solaris 10 x86 behind a typical NAT router/firewall. On Solaris, all connections are reported to have the same, incorrect, remote IP regardless of who connects, whether they are external to the local network or internal (me). The exact same code runs as expected on linux (slack 10 2.4.x), and windows, (with winsock modifications etc). So for example if a user from outside with IP 65.234.67.98 connects to the Solaris server and I connect from inside from say 192.168.1.100, the server reports the IP: 88.45.5.8 for both of us yet on linux it reports the correct IPs. I figure it must know the real IPs somewhere since everything else works fine (every user gets what they're supposed to etc), so what's so different about Solaris and remote addresses? Why do getpeername() and such return what you'd expect on linux but that goofy IP on Solaris when both server programs are essentially clones? Could this have something to do with how the network interface is configured?
Is that machine 64-bit? Does it use IPv6? Is there something else that may be a bug in your code that corrupts the data, but doesn't on Linux/Windows?
Also, what does "netstat -na | grep -i tcp" tell you the remote addresses are?
Also, what does "netstat -na | grep -i tcp" tell you the remote addresses are?
It's not 64-bit. I admittedly don't know much about Solaris, but I figured maybe it had something to do with IPv6 or the like. Netstat shows correct remote addresses in IPv4 and nothing in IPv6. ("netstat -na | grep -i tcp" returns
TCP: IPv4
TCP: IPv6 )
I'm open to the possibilty of a bug in my code but I honestly can't see where that would be when the exact same code works fine on linux as well.
TCP: IPv4
TCP: IPv6 )
I'm open to the possibilty of a bug in my code but I honestly can't see where that would be when the exact same code works fine on linux as well.
It could be a Solaris bug. Try writing the simplest possible program, that just connects to localhost port 80 (or some other port that you know will be open), and calls getpeername() to see whether it returns an OK address. Also, read the Solaris manual for getpeername() and see if it documents the call differently than Linux.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement