Unity Proxy server relaying messages to the wrong ip

Salutations.

First off, my networking code is functioning as expected, I can verify this by turning off the use of a unity proxy. Once turned off the game runs exactly as designed.

When I enable the use of a proxy server everything goes swimmingly until the proxy suddenly starts relaying messages from the game server to the wrong client ip. I have not enabled the use of proxies on both the client and the server, only the server. Here’s a snip of the log (gathered via the -e 9 cli switch).

22-08-2011 12:38:34 DEBUG Relaying for server at 94.254.94.154:25000, to client at 94.254.94.154:43785, ID of relayed message is Unknown ID 0
22-08-2011 12:38:34 DEBUG Received packet on port 5055
22-08-2011 12:38:34 DEBUG Relaying for server at 94.254.94.154:25000, to client at 161.1.161.101:2475, ID of relayed message is Unknown ID 0
22-08-2011 12:38:34 DEBUG Received packet on port 5055
22-08-2011 12:38:34 DEBUG Relaying for server at 94.254.94.154:25000, to client at 161.1.161.101:2475, ID of relayed message is Unknown ID 0
22-08-2011 12:38:40 DEBUG Received packet on port 5055
22-08-2011 12:38:40 DEBUG Relaying for server at 94.254.94.154:25000, to client at 94.254.94.154:43785, ID of relayed message is Unknown ID 0
22-08-2011 12:38:44 DEBUG Received packet on port 50000
22-08-2011 12:38:44 DEBUG Relaying for client at 94.254.94.154:43785, to server at 94.254.94.154:25000, ID of relayed message is Unknown ID 0
22-08-2011 12:38:44 DEBUG Received packet on port 50000

94.254.94.154 is indeed my own ip, and I’m running both the client and the server from this ip. As you can see, the proxy continues to relay messages from the client to the server and this is easily verified in-game. But messages, for instance state synchronizations, from the server to the client are sent to the wrong ip.

I’ve grep’ed for the ip 161.1.161.101 throughout the proxy source but cannot locate it. I’m not sure what this ip is or how it replaced the client’s real ip all of a sudden. It appears to lead to a server on the west coast of usa, a far cry from my own abode here in sweden.

The end result of this is that the game server player can see the client’s character move about the screen just fine, as can he see himself move around due to locally changing the transform position. But the client does not receive the state synchronization from the server, thus resulting in the game server’s character standing still. Figured I’d append this since it proves that the connection to the proxy is never lost on either end. The proxy just sends the game server’s messages to the wrong ip.

I noticed that the same problem was previously mentioned in both the forum and on the answers board, but none of them have received any replies or resolutions.

Versions;
Unity Pro 3.4.0f5
Proxy server 2.0.1f1

Just a quick follow-up here to make matters even more confusing. We did some rudimentary checking into the problem on IRC;

NCarter: TFeldt: I just checked, and the bit pattern of 94.254.94.154 is complement of 161.1.161.101.
NCarter: 94.254.94.154 is 01011110 11111110 01011110 10011010, 161.1.161.101 is 10100001 00000001 10100001 01100101
NCarter: Which is just bizarre.
NCarter: I have no idea what that means.

Is it somehow related to an unsigned to signed comparison somewhere? I tried to check through the heap of compiler warnings but multiple 7000 lines long cpp files with external variables and structs got the better of me. Can only tip my hat to Larus for having the courage to crawl into that tiger’s den on a regular basis.