News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Spurious network activity

Started by Ters, June 19, 2018, 10:48:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters

I just updated my SVN working directory and built a new Simutrans executable. When I loaded my game, the firewall suddenly triggered a message that sim.exe was trying to access the Internet. I can't see why Simutrans would want to do that when loading a game, so I just blocked it. Simutrans seemed to have no problems with that, except for the FPS hit it took from being frozen.

An_dz

No connection attempts here and no firewall request. Are you sure you did not run with server commands or server settings in config?

Ters

I've never actively done so or never intend to do. So unless running as server is now default and must be explicitly turned off, that can't be it.

An_dz

Did you compile with miniupnpc?

Ters

Probably not. I did no active changes in my setup. And miniupnpc doesn't sound like something that would come with MSYS2 out of the box. Furthermore, Simutrans was trying to access some server on port 80 (I don't remember the IP), so it was likely HTTP traffic.

prissi

Then it is most likely getting its IP (asking simutrans-forum.de/getIP.php). But it should do this only for starting a server. You did not open the game while (hosting at a server was checked?)

Ters

I double-clicked sim.exe as I usually do. On this occasion, I might have clicked new game and then closed the window in order to test out cursor behavior when panning the map around, and then opened the main menu and selected load game. If not, I simply selected load game from the welcome screen. Then I clicked on the game, and during the loading, or just as it finished, the firewall message popped up.

I think the IP-address started with a single digit, which I noted as unusual, possibly a 5. If it was (unintentionally) trying to host a game, this outgoing connection happened before it started listening for incoming connections, I think, or the firewall would have warned me about a program wanting to open a listening port instead.

Ters

I've figured out where the connect is coming from. It comes from loadsave_frame.cc line 77. Apperently it is trying to announce my Simutrans as a server to the Internet, even though "Start this as server" is not pressed and something called "server_announce" in simuconf.tab is commented out (and supposedly defaults to off).

r8476 seems likely to be the culprit. I would assume that everyone loading a save game in a recent version of Simutrans is reporting to some server that they are playing Simutrans, which might be illegal without their explicit consent.

An_dz

Confirmed now, loading a savegame announces as a server always. Fix seems pretty easy though, just change the else to an else if (easy_server.pressed) {

Also, should that checkbox not be removed when without miniupnpc?

DrSuperGood

Quotewhich might be illegal without their explicit consent.
But it is so useful for tracking usage metrics! jk.

If this is in the latest release, another release is likely needed with this fixed. Do not want people to think we do not respect their privacy.

prissi

The better correction is to not allow announces, if you do not run a server. I.e. simworld line 6821. This will also catch other illegal uses. SInce the port is zero in all those cases, is should never be registered at the server.

ACarlotti

I believe I just encountered this issue myself. When I added the -server flag on the command line (for local testing purposes) I discovered that the game was intermittently being unresponsive for tens of seconds (the unresponsiveness is probably in itself a bug). I discovered that this was happening while trying to announce the server:

#0  0x00007ffff7f9c457 in connect () from /usr/lib/libpthread.so.0
#1  0x00005555557c4efa in network_open_address (cp=cp@entry=0x5555559cb47a "servers.simutrans.org:80", err=@0x7fffffffa4a8: 0x0) at network/network.cc:294
#2  0x00005555557d20c0 in network_http_post (address=address@entry=0x5555559cb47a "servers.simutrans.org:80", name=name@entry=0x5555559df9a5 "/announce",
    poststr=0x5555585710b0 "&dns=&alt_dns=&port=13353&aiv=900&st=1&rev=0&ver=Simutrans \"120\" \".\" \"4\" \".\" \"1\" \" Nightly\" (r@svn@) built \"May 15 2019\"&pak=pak64%20120.4.1%20r1974&start=1,1930&name=&comments=&email=&pakurl=&infurl="..., localname=localname@entry=0x0)
    at network/network_file_transfer.cc:314
#3  0x00005555559462bd in karte_t::announce_server (this=0x555558572660, status=<optimized out>) at gui/components/../../utils/cbuffer_t.h:111
#4  0x000055555595296a in karte_t::interactive (this=this@entry=0x555558572660, quit_month=quit_month@entry=2147483647) at simworld.cc:6685
#5  0x00005555558ec932 in simu_main (argc=argc@entry=2, argv=argv@entry=0x7fffffffe9c8) at simmain.cc:1428
#6  0x0000555555901d8c in sysmain (argc=2, argv=0x7fffffffe9c8) at simsys.cc:1056
#7  0x00007ffff7784ce3 in __libc_start_main () from /usr/lib/libc.so.6
#8  0x000055555561695e in _start () at network/../tpl/vector_tpl.h:24


It seems that this is a consequence of the line env_t::server_announce = contents.get_int("server_port", env_t::server_port ); being added in r8431 - I think this effectively sets the default value of server_announce to be non-zero (though it can still be explicitly zeroed in simuconf.tab). I don't see any reason to include that line, so can we just delete it?

EDIT: Actually it is probably meant to be setting env_t::server_port

prissi