Bug 129928 - loolwsd doesn't listen on 127.0.0.1 when setting it to use loopback and ipv4 and ipv6
Summary: loolwsd doesn't listen on 127.0.0.1 when setting it to use loopback and ipv4 ...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-10 13:48 UTC by crap
Modified: 2020-02-12 10:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description crap 2020-01-10 13:48:13 UTC
In the current code debian package version 4.2.0-2 there is following problem:

When setting 

<net desc="Network settings"> <listen type="string" >loopback</listen> 

so the daemon only listens on localhost, it is not possible to connect to it using 127.0.0.1 (at least not for a reverse proxy... looking at netstat it seems that it's listening at the ipv6 localhost, but I didn't try that out). It is necessary to set 

<proto type="string" default="all" desc="Protocol to use IPv4, IPv6 or all for both">IPv4</proto> 

so to change it from all to IPv4
so it properly listens on the ipv4 localhost.
Comment 1 site+dfd 2020-02-09 09:45:35 UTC
I encountered the same problem.

This is probably an Poco issue. There are a few issues on their tracker that has similarities.

https://github.com/pocoproject/poco/issues/2226
https://github.com/pocoproject/poco/issues/2605
Comment 2 Andras Timar 2020-02-11 11:59:01 UTC
I tend to agree that it is not our bug. We set everything right in LOOLWSD.cpp:

    {
        std::string proto = getConfigValue<std::string>(conf, "net.proto", "");
        if (!Poco::icompare(proto, "ipv4"))
            ClientPortProto = Socket::Type::IPv4;
        else if (!Poco::icompare(proto, "ipv6"))
            ClientPortProto = Socket::Type::IPv6;
        else if (!Poco::icompare(proto, "all"))
            ClientPortProto = Socket::Type::All;
        else
            LOG_WRN("Invalid protocol: " << proto);
    }

    {
        std::string listen = getConfigValue<std::string>(conf, "net.listen", "");
        if (!Poco::icompare(listen, "any"))
            ClientListenAddr = ServerSocket::Type::Public;
        else if (!Poco::icompare(listen, "loopback"))
            ClientListenAddr = ServerSocket::Type::Local;
        else
            LOG_WRN("Invalid listen address: " << listen << ". Falling back to default: 'any'" );
    }
Comment 3 Commit Notification 2020-02-12 10:21:12 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/commit/e24eda5d6460895d2d1e3c15d602debc8f7d7a5d

tdf#129928 add a comment