bugFreeciv - Bugs: bug #15559, Client can't connect to its...

 
 
Show feedback again

bug #15559: Client can't connect to its locally started server

Submitted by:  None
Submitted on:  Mon 08 Mar 2010 04:12:42 PM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 8Status: Fixed
Assigned to: Jacob Nevins <jtn>Originator Email: -unavailable-
Open/Closed: ClosedRelease: 2.2
Operating System: GNU/LinuxPlanned Release: 2.2.4,2.3.0,2.4.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 25 Nov 2010 09:18:25 PM UTC, SVN revision 18606:

Overhaul IPv4/IPv6 handling when creating connections and listening sockets.
Fixes a problem where client could not connect to its own server in some
circumstances when starting a local game on modern Linux and OpenBSD.

Patch by George Koehler (kernigh@gna).

See gna bug #15559.

(Browse SVN revision 18606)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 25 Nov 2010 09:15:19 PM UTC, SVN revision 18605:

Overhaul IPv4/IPv6 handling when creating connections and listening sockets.
Fixes a problem where client could not connect to its own server in some
circumstances when starting a local game on modern Linux and OpenBSD.

Patch by George Koehler (kernigh@gna).

See gna bug #15559.

(Browse SVN revision 18605)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 25 Nov 2010 09:11:25 PM UTC, SVN revision 18604:

Overhaul IPv4/IPv6 handling when creating connections and listening sockets.
Fixes a problem where client could not connect to its own server in some
circumstances when starting a local game on modern Linux and OpenBSD.

Patch by George Koehler (kernigh@gna).

See gna bug #15559.

(Browse SVN revision 18604)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Wed 24 Nov 2010 02:42:53 AM UTC, comment #42:

Stealing this bug in Marko's absence; I intend to commit the patches to S2_2, S2_3, and trunk soon, unless anyone objects.

Patches rebased against current svn. I've performed many of the same tests I did before, including verifying that I can still see the original problem and that this fixes it (having upgraded to Ubuntu 10.04 in the meantime).

I noticed that the v8 S2_2 patch additionally added NI_NAMEREQD to a call to getnameinfo in server/sernet.c, whereas the trunk one didn't. I assume this is a stray bit from experimenting with bug #16509 (which was happening around the same time), the eventual patch for which conflicts with this. The consensus in bug #16509 seemed to be that NI_NAMEREQD wasn't required, anyway, and it doesn't seem relevant here, so I've dropped it from the S2_2 patch. George, is that OK?

(file #11363, file #11364)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Wed 24 Nov 2010 02:01:06 AM UTC, comment #41:

I finally got around to trying Christian's patched Windows build on Windows 7. I compared it to 2.2.3.

There was no difference in behaviour in anything I tried (i.e., no regression). Since the problem wasn't originally a Windows problem, I think that's OK.

I tried:

  • starting a local game from the client as normal: OK
  • starting a separate server (no special arguments) and connecting to it from client:
    • from GUI, to localhost:5556: OK
    • from GUI, to hostname:5556 (as found by LAN scan): OK
      • (That's the first time I've ever seen the LAN scan work. It has never worked at all for me on Linux. But that's another bug.)
    • "-s 127.0.0.1 -a": OK
    • "-s 169.254.64.50 -a": OK
    • "-s ::1 -a": client crash(?), server sees nothing
    • "-s fe80::ac36:49f3:cc39:4032%11 -a": ditto

I didn't have any luck trying to get the patched server to listen on an IPv6 address (::1, fe80::ac36:49f3:cc39:4032%11, fe80::ac36:49f3:cc39:4032). I didn't try vanilla 2.2.3.

I think my Windows 7 installation must support IPv6 at some level, as "ping localhost" displays "Pinging hostname [::1]". However, I've done nothing special to set it up (the machine wasn't even on a network when I tested this). I'm not too worried.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Fri 29 Oct 2010 05:52:46 PM UTC, comment #40:

Thanks Christian.

Tested this on a WinXP machine and it seems to work fine here too.

Daniel Markstedt <dmarks>
Project Administrator
Sat 23 Oct 2010 06:54:28 PM UTC, comment #39:

The attached v8 patch fixes the EADDRNOTAVAIL problem.

An S2_2 Windows test build is available at http://download.gna.org/freeciv/packages/windows/testing/Freeciv-S2_2-20101023-win32-gtk2-setup.exe

Starting a new game from the client still seems to work. I didn't test other scenarios or IPv6.

(file #10892, file #10893)

Christian Prochaska <cproc>
Project Administrator
Tue 19 Oct 2010 09:14:47 AM UTC, comment #38:

Compiling server for MinGW:
../../../src.patched/server/sernet.c: In function ‘server_open_socket’:
../../../src.patched/server/sernet.c:1056: error: ‘EADDRNOTAVAIL’ undeclared (first use in this function)
../../../src.patched/server/sernet.c:1056: error: (Each undeclared identifier is reported only once
../../../src.patched/server/sernet.c:1056: error: for each function it appears in.)

Marko Lindqvist <cazfi>
Project Administrator
Tue 19 Oct 2010 07:22:36 AM UTC, comment #37:

I'll test everything I can today and tomorrow and commit this if no problems is found.

Marko Lindqvist <cazfi>
Project Administrator
Sat 16 Oct 2010 06:50:26 PM UTC, comment #36:

I do have a PeeCee in the house, but no IPv6. Would it help?

David Lowe <doctorjlowe>
Fri 15 Oct 2010 12:59:10 AM UTC, comment #35:

Christian, would you have time to help us out here? We could really use a Windows test build made from S2_2 with this patch applied.

Daniel Markstedt <dmarks>
Project Administrator
Thu 14 Oct 2010 08:11:29 PM UTC, comment #34:

It would be good not to get to the next release without having dealt with this.

The main remaining question seems to be whether it works on Windows. Who can build for Windows? I can't, but I might be able to do some limited testing of binaries someone else has built (probably not involving actual IPv6).

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 26 Sep 2010 09:38:14 PM UTC, comment #33:

Just played with the v7 patch on S2_2 on my system (Ubuntu Linux 9.04). Looks good.

Tried all my tests from comment #22 and comment #23 and they all work without any errors.

Tried making something listen on IPv4 only ("nc -l -p 5556" appears to behave like this on my system) and a manually started server failed to start ("0: bind failed: Address already in use"), as desired. A client-spawned server moved on to port 5557.

Tried disabling IPv6 on my system (by rebooting with "ipv6.disable=1" on the kernel command line) and both client-spawned and manually-started server continued to work as expected.

Tried the recipe from comment #26 to reproduce the original bug where a client couldn't connect to its spawned server, and successfully did so with unpatched S2_2. Verified that with the patch, the problem goes away.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 26 Sep 2010 12:21:08 AM UTC, comment #32:

This is v7 patch.

Because I am author of v1 thru v5, I decided to try v7. The only changes from v6 to v7 are in server_open_socket() of server/sernet.c, where I tried to add the recent ideas from comment #27 to comment #31.

(file #10446, file #10447)

George Koehler <kernigh>
Thu 23 Sep 2010 01:51:03 PM UTC, comment #31:

> try to listen on all available IP address families (specifying
> "V6ONLY" for lack of ambiguity), and fail if it can't bind all
> of them.


Just take care of not failing when it's impossible to bind IPv6 address on a system where IPv6 has been disabled.

Marko Lindqvist <cazfi>
Project Administrator
Tue 21 Sep 2010 08:41:47 PM UTC, comment #30:

From x11_create_display_inet() of openssh-5.6p1/channels.c:

During X11 forwarding, if any bind() fails, then OpenSSH loops to close all sockets.

This only happens during X11 forwarding! Other code at channel_setup_fwd_listener() from channels.c, and at server_listen() from sshd.c, seems to allow bind() to fail.


From openssh-5.6p1/misc.c:

George Koehler <kernigh>
Mon 20 Sep 2010 11:59:02 PM UTC, comment #29:

Clearly the server should run without emitting error messages regardless of whether it finds itself on a "v6only" behaving system. Specifying setsockopt(V6ONLY), or whatever it's called, with the current code might be sufficient, if it's portable (haven't checked).

Another approach which satisfies this requirement is to do what I believe OpenSSH does, which is to try to listen on all available IP address families (specifying "V6ONLY" for lack of ambiguity), and fail if it can't bind all of them. This is done to avoid an attack (CVE-2008-1483) where a local attacker listened on IPv4 only, the SSH server listened on IPv6 and quietly failed on IPv4, the user misdirected traffic at the IPv4 listener, and the attacker captured traffic. (I haven't thought if there are any interesting similar attacks against Freeciv.)

Unfortunately I haven't got round to working out how OpenSSH does this, and in particular how it works out whether it's on a system that doesn't support IPv6 at all, although I really should for another project.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 20 Sep 2010 07:07:43 PM UTC, comment #28:

>> "IPv4 bind failed: Address already in use"
> Print that particular error message only if also IPv6 bind failed?


To be exact, print no error messages if we can listen() to at least one socket?

OpenBSD 'man getaddrinfo' shows an example of this:

Other programs had no 'cause' variable and no 'save_errno' stuff around close(), but they kept the idea to ignore errors if they listen() to at least one socket.

The old Freeciv code printed every error that happens. When I made the plural-listen patch, I tried to preserve the old code, so it alarmingly prints every error that happens!

So someone must decide whether to print no error messages if Freeciv can listen() to at least one socket.

George Koehler <kernigh>
Mon 20 Sep 2010 10:43:23 AM UTC, comment #27:

> If freeciv-server says "IPv4 bind failed: Address already in use",
> then its IPv6 socket might accept IPv4 connections.


That error message would seem quite alarming for someone who does not know that it's actually ok in his/her setup. Any idea what we should do about that? Print that particular error message only if also IPv6 bind failed?

Marko Lindqvist <cazfi>
Project Administrator
Sat 11 Sep 2010 03:02:16 AM UTC, comment #26:

I switched from my v5 patch and applied the v6 patch by Jtn. (I also use my own patch from bug #16458, because that bug blocks configure enabling IPv6.) I confirm that p22-plural-listen-v6.diff and ptrunk-plural-listen-v6.diff work with my OpenBSD system.

We think that the patch works with OpenBSD and with Linux, but the other platforms are a mystery.


I also tried building S2_2 with --disable-ipv6. I confirm that p22-plural-listen-v6.diff does not break a --disable-ipv6 build.


The original bug, as I understand it, is that the client fails to connect to its own server if both of the following are true:

  1. Socket option IPV6_V6ONLY defaults to on (like *BSD with net.inet6.ip6.v6only=1 or Linux with net.ipv6.bindv6only=1).
  2. "localhost" resolves to 127.0.0.1 but not ::1.

To reproduce the original bug, you want to "sysctl -w net.ipv6.bindv6only=1" (or equivalent) and you want to kill the /etc/hosts line "::1 localhost" (or equivalent). Then the server socket will accept only IPv6 connections, and the client will fail to make an IPv4 connection to "localhost".


To use a link-local address from fe80::/64, you must set a a scope (the 'sin6_scope_id' field of 'struct sockaddr_in6'). BSD getaddrinfo() understand the syntax 'fe80::numbers%interface', where the network interface is the scope.

For example, here is my Ethernet interface (with an edited address):

If I say 'ping6 fe80::212:34ff:fe89:abcd%gem0' then it works, but if I say 'ping6 fe80::212:34ff:fe89:abcd' (without the '%gem0') then it fails.

This is probably because Freeciv uses gethostbyname2() instead of getaddrinfo(); see bug #16623.


The older versions of the patch, v1 through v4, added this extra code to server_open_socket(), where opt = 1:

I deleted this code from v5, because I was uncertain about whether to include or exclude this code. I guess that this code is not necessary to fix this bug.

If freeciv-server says "IPv4 bind failed: Address already in use", then its IPv6 socket might accept IPv4 connections. This is not ideal, because messages will refer to addresses like "::ffff:192.168.0.56" instead of "192.168.0.56".

George Koehler <kernigh>
Fri 10 Sep 2010 05:11:42 PM UTC, comment #25:

I'd prefer to retarget for 2.2.4. AFAIK it's been like this in all 2.2.x releases so I wouldn't consider it a showstopper.

Daniel Markstedt <dmarks>
Project Administrator
Fri 10 Sep 2010 09:06:50 AM UTC, comment #24:

I did look in the some older version of the patch, and I'm certain it works on linux. My only concern is that it has not been much tested with other systems (I can try to find time to make Windows/MinGW build). It needs more exposure before release.

I would actually suggest postponing 2.2.3 release for giving time for people to test this patch in various systems.

Marko Lindqvist <cazfi>
Project Administrator
Fri 10 Sep 2010 08:55:41 AM UTC, comment #23:

Just found time to play a bit more.

I did "sysctl -w net.ipv6.bindv6only=1" to try to reproduce the problem. Without the patch, starting a server from the client works, but starting a server manually and then trying to connect to it with IPv4 addresses (e.g. 127.0.0.1) fails: "1: Connection to server refused. Please start the server." I assume this is the gist of the original problem, although it's not quite as reported.

With the patch, all the things that I tried in comment #22 just worked (with no warnings, as I guessed).

If the aim of this patch is to make Freeciv work regardless of whether binding a single socket causes it to listen on both of IPv4/IPv6 or just one, I think it's achieved that.

(Still not actually looked at the code though...)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 09 Sep 2010 11:33:12 PM UTC, comment #22:

Erk. I know a little about this stuff, but I haven't run into the original problem, and can't promise to have time to have a serious look at it in time for the release. But I think it's an important fix.

I have quickly applied and compiled the patch to S2_2, and it hasn't made things any worse for me in my (minimal!) tests -- I can still start a server from the client, or start one manually and connect the client to localhost.

In the latter case I do get this from the server:

Oops, the "????" is a cosmetic bug in the patch: there's a switch statement in server_open_socket() without any "break;"s so it falls through. But that only affects error reporting, not functionality. Fixed version attached anyway (v6); with the fix, it says "IPv4 bind failed".

My system is Ubuntu Jaunty (9.04), IPv6 not configured beyond how it comes out of the box. "sysctl net.ipv6.bindv6only" says 0. (I think this means my system's an "old" Linux system; AIUI, it's modern Linuxes and non-Linuxes that suffer the original problem due to having this 1 or equivalent behaviour.)

The following all work for me:

client/freeciv-gtk2 -s 127.0.0.1 -a
client/freeciv-gtk2 -s ::1 -a
client/freeciv-gtk2 -s X.X.X.X -a [where X.X.X.X is eth0's IPv4 address]

(My eth0 also claims to have a link-local IPv6 address FE80::..., but that doesn't seem to work for anything, not just Freeciv; I assume this is just because I haven't set IPv6 up. So no data.)

So I suspect the warning is harmless, and won't occur on systems affected by the original bug.

Hope some of this is useful to someone in deciding whether or not this goes in 2.2.3... personally I reckon we should go for it.

(file #10270, file #10271)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 09 Sep 2010 08:31:07 PM UTC, comment #21:

Unfortunately, I don't know enough about sockets to handle it. Someone else?

pepeto <pepeto>
Project Member
Thu 09 Sep 2010 07:00:47 PM UTC, comment #20:

I don't have time to check this before Sunday (and 2.2.3 release) Feel free to steal it from me.

Marko Lindqvist <cazfi>
Project Administrator
Thu 09 Sep 2010 04:11:16 PM UTC, comment #19:

Is Marko around?

pepeto <pepeto>
Project Member
Thu 09 Sep 2010 02:18:29 AM UTC, comment #18:

I changed the error code in server/sernet.c to try to identify the socket that causes the error. I also remade the trunk patch, so now trunk seems to work.

This is the last version of the patch from me, unless I discover that I made some mistake.

  • p22-plural-listen-v5.diff for S2_2 r17952
  • ptrunk-plural-listen-v5.diff for trunk r17952

(file #10258, file #10259)

George Koehler <kernigh>
Fri 03 Sep 2010 10:59:02 PM UTC, comment #17:

I made a trunk version of the patch, but it is broken. The client complains about unknown error 0 and the server says '2: Lost connection: c1 from localhost (connection incomplete).' I might have made a mistake in client/clinet.c; I need more time to find the mistake and post a working patch.

I am attaching a broken patch for trunk r17924.

The S2_2 version (file #10046) continues to work for me. This week, I played at least 200 turns of S2_2.

(file #10146)

George Koehler <kernigh>
Sat 28 Aug 2010 04:36:05 PM UTC, comment #16:

gcc gives the same warning to me. gcc notices that if name_count <= 0, then we never enter the for loop to initialize 'sock'.

I am attaching a -v4 patch that prevents the warning. The patch is for S2_2.

I have never used trunk. I am now trying to compile trunk so that I can port the patch.

(file #10046)

George Koehler <kernigh>
Tue 24 Aug 2010 08:35:09 AM UTC, comment #15:

> server/meta.c: In function ‘send_to_metaserver’:
> server/meta.c:236: error: ‘sock’ may be used uninitialized in this function


This seems like gcc stupidity, but needs to be fixed anyway.

Marko Lindqvist <cazfi>
Project Administrator
Tue 24 Aug 2010 08:31:54 AM UTC, comment #14:

Can you make also TRUNK version of this?

Marko Lindqvist <cazfi>
Project Administrator
Fri 20 Aug 2010 06:43:11 PM UTC, comment #13:

My -v2 patch (from S2_2 r17797) causes a merge conflict in server/sernet.c. I am attaching a new -v3 patch (from S2_2 r17820) to solve the conflict.

If you already applied the -v2 patch, you might

$ patch -R < p22-plural-listen-v2.diff
$ svn up
$ patch < p22-plural-listen-v3.diff

or you might

$ svn up
$ svn revert server/sernet.c server/meta.c client/clinet.c client.servers.c
$ patch < p22-plural-listen-v3.diff

(file #9941)

George Koehler <kernigh>
Thu 19 Aug 2010 03:17:23 PM UTC, comment #12:

The patch solved the problem I was having in bug #16476. I'd like to propose a 2.2.3 fix target.

Daniel Markstedt <dmarks>
Project Administrator
Thu 19 Aug 2010 12:40:50 AM UTC, comment #11:

Here is my second attempt p22-plural-listen-v2.diff

This patch uses net_lookup_service() to get both IPv4 and IPv6 addresses. The server listens to all addresses, using an array 'listen_socks'. The client tries all addresses, and uses the first address to work.

  • If your system enables IPV6_V6ONLY by default (like *BSD with net.inet6.ip6.v6only=0 or Linux with net.ipv6.bindv6only=0), then this patch should allow your freeciv-server to accept both IPv6 and IPv4 connections.
  • If your /etc/hosts defines "localhost" as both 127.0.0.1 and ::1, or only 127.0.0.1, or only ::1, then this patch should allow your Freeciv client to connect to its locally started server.

Patch is for S2_2. Please test patch.

(file #9918)

George Koehler <kernigh>
Tue 17 Aug 2010 12:17:08 AM UTC, comment #10:

AF_INET6 configure check is now bug #16458.

Failure to close extra connections is now bug #16461. (I was wrong. This is not a new bug, because one socket is already enough to accept too many connections. I was idiot and forgot to read my listen(2) manual page.)

So this bug, bug #15559, is now only about fixing the IPV6_SUPPORT code. I am working on the next version of the patch; file #9838 is not complete because it fixed the server but not the client. The server must try to listen to both IPv4 and IPv6; the client must try to connect to either IPv4 or IPv6.

George Koehler <kernigh>
Mon 16 Aug 2010 10:41:52 AM UTC, comment #9:

> 1. This patch fixes the AF_INET6 configure check. (OpenBSD needs
> <sys/types.h> before <sys/socket.h>.)
> 2. This patch replaces the one socket 'sock' with an array
> 'listen_socks', and listens to all connections in the array.
> 3. This patch adds a new bug. The multiple sockets can accept
> too many connections, but server_make_connection() in
> server/sernet.c fails to close the extra connections.


1 & 2 are clearly separate issues. Could you open new bugreport about the configure issue and extract relevant parts of your patch in to new patch there.

Marko Lindqvist <cazfi>
Project Administrator
Sun 15 Aug 2010 07:05:43 PM UTC, comment #8:

While I am using my patch (file #9838),
'./ser --bind ::' starts an IPv6-only server,
'./ser --bind 0.0.0.0' starts an IPv4-only server.

If I run IPv4-only server, then my Freeciv client can connect to '127.0.0.1' but refuses to connect to 'localhost'. This problem is with the client, not the server. If I run 'nc localhost 5556' then I can connect to either the IPv6-only server or the IPv4-only server.

So file #9838 is not enough to fix the broken IPV6_SUPPORT; the Freeciv client also needs a fix.

George Koehler <kernigh>
Sun 15 Aug 2010 03:09:33 AM UTC, comment #7:

I have a similar bug using OpenBSD. I am running an old snapshot of OpenBSD 4.5-current.

My server (S2_2 r17748) accepted connections from "localhost" and from "127.0.0.1", but not from "::1". I found that my server had no IPv6 support, because configure failed the AF_INET6 check. OpenBSD has AF_INET6, so I fixed configure and rebuilt my server with IPv6 support.

Now my server, with IPv6 support, accepts connections from "localhost" and "::1", but not from "127.0.0.1". My server refuses IPv4 connections because it listens only to IPv6 socket.

  • RFC 3493 specifies that IPv6 socket may use IPv4 with addresses like "::ffff:172.34.5.6".
  • Some systems (at least OpenBSD) require IPv6 sockets to use IPv6 only. This has security reason: "IPv4-Mapped Addresses on the Wire Considered Harmful".
  • I have rumours that some versions of Debian, FreeBSD, NetBSD and Microsoft Windows enable IPV6_V6ONLY by default.
  • OpenBSD provides zero ways to disable IPV6_V6ONLY.
  • Opinions from internet do range from 'IPV6_V6ONLY on is stupid' to 'IPV6_V6ONLY off is stupid'.

The correct way is to listen to multiple sockets: both IPv4 socket and IPv6 socket. Examples are identd.c and sshd.c of OpenBSD. They use getaddrinfo(3) to get list addresses, create one socket(2) per address, then poll(2) multiple sockets to listen(2).

I am attaching a patch p22-listen-plural.diff for S2_2 that attempts to use multiple sockets. This might fix bug #15559 and bug #16149.

  1. This patch fixes the AF_INET6 configure check. (OpenBSD needs <sys/types.h> before <sys/socket.h>.)
  2. This patch replaces the one socket 'sock' with an array 'listen_socks', and listens to all connections in the array.
  3. This patch adds a new bug. The multiple sockets can accept too many connections, but server_make_connection() in server/sernet.c fails to close the extra connections.

This patch allows my server to accept all of "localhost", "::1" and "127.0.0.1". I will continue to run S2_2 with my patch p22-listen-plural.diff to look for bugs. I would like other players to check if this patch fixes bug #15559, fixes bug #16149, or breaks platforms other than OpenBSD.

(file #9838)

George Koehler <kernigh>
Fri 04 Jun 2010 03:56:09 PM UTC, comment #6:

I have 2.2.0 in debian squeeze with ipv6 disabled. (from grub.cfg kernel option
so $sysctl -w net.ipv6.bindv6only=0 gives
error: "net.ipv6.bindv6only" is an unknown key)

Also my gtk-client and my sdl-client cant start a game and if start server and client seperately my client connects to the local server only if i change 'localhost' to 127.0.0.1.
If i dont do that i get an error message in the bottom saying that 'protocol is not supported'

Also
$freeciv-server -d 3 -b localhost [enter]-->
This is the server for Freeciv version 2.2.0
Learn ... Freeciv .. http://www.freeciv.org/
3: log started
0: Detected fatal error in ../../server/sernet.c line 985:
0: socket failed: Protocol not supported

Prekates Alexandros <chomwitt>
Project Member
Wed 10 Mar 2010 07:32:27 PM UTC, comment #5:

It seems you have one: user #6131. And you are still included officially in this project.

pepeto <pepeto>
Project Member
Wed 10 Mar 2010 07:24:49 PM UTC, comment #4:

Hi pepeto, I don't think I even have an account here. Thanks for the greet, it is nice to see the new release that you all have worked on, I think it is pretty awesome.

Anonymous
Wed 10 Mar 2010 11:15:03 AM UTC, comment #3:

Nice to see you arround, englabenny! Did you forgot to log in?

pepeto <pepeto>
Project Member
Wed 10 Mar 2010 04:06:37 AM UTC, comment #2:

Thank you for this reponse!

Initially reported as a debian bug since I (rightfully, it seems) thought it was a debian issue.

Confirming that the following commandline fixes the condition freeciv had and lets the client connect to its server:

sudo sysctl -w net.ipv6.bindv6only=0

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572990

Anonymous
Tue 09 Mar 2010 10:22:35 PM UTC, comment #1:

You are probably another victim of a recent change in Debian squeeze which sets net.ipv6.bindv6only = 1 in
/etc/sysctl.d/bindv6only.conf
See e.g. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560044

As a result the server listens on ::1 (IPv6 only), and the client fails to connect to localhost (IPv4).

But eventually freeciv should change the way it opens the listening socket(s) so that it works in both configurations.

Andreas <anbe>
Mon 08 Mar 2010 04:12:42 PM UTC, original submission:

I have found the following problem in the official 2.2 release (using 2.2.0-1 from debian unstable, assumed unchanged from original), and in SVN rev r17019 of the S2_2 branch that I compiled.

The gtk client is unable to start local games (where it starts the server and then connects to it). If I click "Start New Game", the client will just hang for a long time, until it timeouts ("you have to start the server yourself, sorry").

Manually starting the server as 'freeciv-server' simply, then using 'freeciv-gtk2 -a', we meet a "Connection refused" error.

The workaround found is that if I explicitly specify the bind address of the server, it will connect to it just fine:

/usr/local/bin/freeciv-server -d 3 -b localhost
/usr/local/bin/freeciv-gtk2 -a

After this it works. The game plays fine!

I don't know if my hostname configuration is wrong, and if it is related:
$ cat /etc/hostname
ulrik-ibook

$ cat /etc/hosts
127.0.0.1 ulrik-ibook localhost.localdomain localhost
127.0.1.1 ulrik-ibook.lan ulrik-ibook

# deutsche weiterleitung
gmail.com mail.google.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

--------

I tried some variations of the hosts file's first two lines, without any success.

$ host ulrik-ibook
Host ulrik-ibook not found: 3(NXDOMAIN)
$ host localhost
localhost has address 127.0.0.1

--------

2.2 is an amazing version of Freeciv, so many parts of the Game were touched and improved. I also like the UI reorganization. So big thanks and congratulations to the devs for accomplishing this release.

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #11363:  S2_3-trunk-plural-listen-v9.diff added by jtn (18kB - text/x-diff - S2_2/S2_3/trunk r18592: v8 rebased, removed NI_NAMEREQD from S2_2 version)
file #11364:  S2_2-plural-listen-v9.diff added by jtn (18kB - text/x-diff - S2_2/S2_3/trunk r18592: v8 rebased, removed NI_NAMEREQD from S2_2 version)
file #10892:  p22-plural-listen-v8.diff added by cproc (18kB - text/x-patch)
file #10893:  ptrunk-plural-listen-v8.diff added by cproc (18kB - text/x-patch)
file #10446:  p22-plural-listen-v7.diff added by kernigh (17kB - application/octet-stream - in server_open_socket(), ideas from comment #27 to comment #31)
file #10447:  ptrunk-plural-listen-v7.diff added by kernigh (19kB - application/octet-stream - in server_open_socket(), ideas from comment #27 to comment #31)
file #10270:  p22-plural-listen-v6.diff added by jtn (16kB - text/x-diff - S2_2/trunk r17969: as v5 with cosmetic error message fix)
file #10271:  ptrunk-plural-listen-v6.diff added by jtn (18kB - text/x-diff - S2_2/trunk r17969: as v5 with cosmetic error message fix)
file #10258:  p22-plural-listen-v5.diff added by kernigh (16kB - application/octet-stream - patch (r17592))
file #10259:  ptrunk-plural-listen-v5.diff added by kernigh (18kB - application/octet-stream - patch (r17592))
file #10146:  ptrunk-plural-listen-broken.diff added by kernigh (17kB - application/octet-stream - trunk version, broken, mistake in client/clinet.c?)
file #10046:  p22-plural-listen-v4.diff added by kernigh (16kB - application/octet-stream - 4th version of patch (S2_2))
file #9941:  p22-plural-listen-v3.diff added by kernigh (16kB - application/octet-stream - 3rd version of patch (S2_2 r17820))
file #9918:  p22-plural-listen-v2.diff added by kernigh (15kB - application/octet-stream - 2nd version of patch (S2_2))
file #9838:  p22-plural-listen.diff added by kernigh (7kB - application/octet-stream - patch for configure.ac and and server/sernet.c)

 

Depends on the following items: None found

Items that depend on this one

Digest:
   task dependencies.

 

Carbon-Copy List
  • -unavailable- added by cproc (Updated the item)
  • -unavailable- added by doctorjlowe (Posted a comment)
  • -unavailable- added by dmarks
  • -unavailable- added by jtn (Updated the item)
  • -unavailable- added by dmarks (Posted a comment)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by kernigh (Updated the item)
  • -unavailable- added by chomwitt (Posted a comment)
  • -unavailable- added by pepeto (Posted a comment)
  • -unavailable- added by anbe (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 25 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 25 Nov 2010 09:23:53 PM UTCjtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 24 Nov 2010 02:42:53 AM UTCjtnAttached File-=>Added S2_3-trunk-plural-listen-v9.diff, #11363
      Attached File-=>Added S2_2-plural-listen-v9.diff, #11364
      StatusNone=>Ready For Test
      Assigned tocazfi=>jtn
      Planned Release2.2.4,2.3.0=>2.2.4,2.3.0,2.4.0
    Sun 21 Nov 2010 11:50:54 PM UTCdmarksPriority5 - Normal=>8
    Sat 23 Oct 2010 06:54:27 PM UTCcprocAttached File-=>Added p22-plural-listen-v8.diff, #10892
      Attached File-=>Added ptrunk-plural-listen-v8.diff, #10893
    Fri 15 Oct 2010 12:59:10 AM UTCdmarksCarbon-Copy-=>Added cproc
    Thu 14 Oct 2010 08:11:29 PM UTCjtnPlanned Release2.2.4=>2.2.4,2.3.0
    Sun 26 Sep 2010 12:21:08 AM UTCkernighAttached File-=>Added p22-plural-listen-v7.diff, #10446
      Attached File-=>Added ptrunk-plural-listen-v7.diff, #10447
    Sun 12 Sep 2010 10:52:37 AM UTCjtnPlanned Release2.2.3=>2.2.4
    Thu 09 Sep 2010 11:33:12 PM UTCjtnAttached File-=>Added p22-plural-listen-v6.diff, #10270
      Attached File-=>Added ptrunk-plural-listen-v6.diff, #10271
    Thu 09 Sep 2010 02:18:29 AM UTCkernighAttached File-=>Added p22-plural-listen-v5.diff, #10258
      Attached File-=>Added ptrunk-plural-listen-v5.diff, #10259
    Fri 03 Sep 2010 10:59:02 PM UTCkernighAttached File-=>Added ptrunk-plural-listen-broken.diff, #10146
    Sat 28 Aug 2010 04:36:05 PM UTCkernighAttached File-=>Added p22-plural-listen-v4.diff, #10046
    Fri 20 Aug 2010 06:43:11 PM UTCkernighAttached File-=>Added p22-plural-listen-v3.diff, #9941
    Thu 19 Aug 2010 03:17:23 PM UTCdmarksPlanned Release=>2.2.3
    Thu 19 Aug 2010 12:40:50 AM UTCkernighAttached File-=>Added p22-plural-listen-v2.diff, #9918
    Mon 16 Aug 2010 10:41:52 AM UTCcazfiAssigned toNone=>cazfi
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup