taskserver icon indicating copy to clipboard operation
taskserver copied to clipboard

[TD-128] Make Taskwarrior listen on IPv4 and IPv6 simultaneously

Open taskwarrior opened this issue 6 years ago • 5 comments

Dirk Deimeke on 2017-02-04T16:16:42Z says:

I would be great to have Taskwarrior listen on IPv4 and IPv6 simultaneously.

taskwarrior avatar Feb 12 '18 01:02 taskwarrior

Migrated metadata:

Created: 2017-02-04T16:16:42Z
Modified: 2017-10-12T02:26:11Z

taskwarrior avatar Feb 12 '18 01:02 taskwarrior

Konstantin on 2017-03-16T07:32:24Z says:

For my Docker environment, I patch taskd with the following patch. It allows to set server variable to, for example *:53589 in order to listen on all interfaces:

{code}

  • -- src/TLSServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/TLSServer.cpp b/src/TLSServer.cpp index e3354f9..6b2f760 100644

  • -- a/src/TLSServer.cpp +++ b/src/TLSServer.cpp @@ -226,7 +226,10 @@ void TLSServer::bind ( hints.ai_flags = AI_PASSIVE; // use my IP

    struct addrinfo* res;

  • int ret = ::getaddrinfo (host.c_str (), port.c_str (), &hints, &res);

  • char *host_str = NULL;
  • if (host.compare("*") != 0)
  • host_str = (char *)host.c_str ();
  • int ret = ::getaddrinfo (host_str, port.c_str (), &hints, &res); if (ret != 0) throw std::string (::gai_strerror (ret));

{code}

taskwarrior avatar Feb 12 '18 01:02 taskwarrior

This won't work unless sys.net.ipv6.bindv6only is off, which is a hack. The correct way would IMHO be to accept any number of server lines, and to bind to all of them in turn.

madduck avatar Feb 28 '18 00:02 madduck

Thanks for the analysis.

I believe (but cannot remember, it's all a blur) that there is already a fix for IPv4 & IPv6 binding in place.

Found it: Commit ece8ec856c995d8fbe4b4966e59d5549ff983177 adds dual-stack support. Does that change anything?

pbeckingham avatar Feb 28 '18 01:02 pbeckingham

I commented there. I think that also requires the bindv6only hack.

madduck avatar Feb 28 '18 01:02 madduck