libreoffice-online/net
Tor Lillqvist a97c8c3455 Fis our use of inet_ntop() etc
We had:
    auto ipv4 = (struct sockaddr_in *)&clientInfo.sin_addr
even if the clientInfo variable itself was a struct sockaddr_in.

And then we also had:
    auto ipv6 = (struct sockaddr_in6 *)&clientInfo.sin_addr
which makes even less sense.

Instead, make clientInfo into a struct sockaddr_in6, which is big
enough to also to be interpreted as a sockaddr_in. Pass the address of
the correct field, either sin_addr or sin6_addr, to inet_ntop(). (Note
that sin_addr in sockaddr_in has a different offset than sin6_addr in
sockaddr_in6.)

At least on my Fedora 28, when I connect using IPv4, accept4() still
returns the client address as an IPv4 mapped IPv6 address, that is
::ffff:192.168.1.113 for 192.168.1.113. So the sample
net.post_allow.host value in loolwsd.xml.in should probably be changed
to have that ::ffff: prefix, too.

Change-Id: I0ad774616b210d94b904982e2f7dc928adc879ed
2018-07-10 23:14:51 +03:00
..
clientnb.cpp loplugin:nullptr 2017-12-20 22:36:41 +05:30
DelaySocket.cpp loplugin:includeform 2017-12-20 21:21:05 +05:30
DelaySocket.hpp Initial DelaySocket goodness. 2017-04-22 18:42:16 +01:00
ServerSocket.hpp Fis our use of inet_ntop() etc 2018-07-10 23:14:51 +03:00
Socket.cpp Fix logging a little. 2018-06-15 17:38:12 +01:00
Socket.hpp net: use std::move() in the StreamSocket ctor 2018-05-24 08:50:30 +02:00
Ssl.cpp Enable SSL in outbound, client websockets ... 2018-05-18 15:16:39 +02:00
Ssl.hpp Make the WSD SSL cipher list configurable. 2017-11-22 15:55:03 +00:00
SslSocket.hpp Enable SSL in outbound, client websockets ... 2018-05-18 15:16:39 +02:00
WebSocketHandler.hpp Implement client websocket masking. 2018-06-15 14:54:19 +01:00