a97c8c3455
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 |
||
---|---|---|
.. | ||
clientnb.cpp | ||
DelaySocket.cpp | ||
DelaySocket.hpp | ||
ServerSocket.hpp | ||
Socket.cpp | ||
Socket.hpp | ||
Ssl.cpp | ||
Ssl.hpp | ||
SslSocket.hpp | ||
WebSocketHandler.hpp |