Jump to content
  • Advertisement
Sign in to follow this  
Syreth

Solaris, NAT and remote address names

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!