Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47956 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/ws2_32/socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index aa0a164ff9..32d3b04403 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -692,6 +692,10 @@ static const int ws_ip_map[][2] = MAP_OPTION( IP_MULTICAST_LOOP ), MAP_OPTION( IP_ADD_MEMBERSHIP ), MAP_OPTION( IP_DROP_MEMBERSHIP ), + MAP_OPTION( IP_ADD_SOURCE_MEMBERSHIP ), + MAP_OPTION( IP_DROP_SOURCE_MEMBERSHIP ), + MAP_OPTION( IP_BLOCK_SOURCE ), + MAP_OPTION( IP_UNBLOCK_SOURCE ), MAP_OPTION( IP_OPTIONS ), #ifdef IP_HDRINCL MAP_OPTION( IP_HDRINCL ), @@ -6011,6 +6015,20 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, case WS_IPPROTO_IP: switch(optname) { + case WS_IP_ADD_SOURCE_MEMBERSHIP: + case WS_IP_DROP_SOURCE_MEMBERSHIP: + case WS_IP_BLOCK_SOURCE: + case WS_IP_UNBLOCK_SOURCE: + { + /* ip_mreq_source is different on Windows, we need to switch source and interface */ + struct ip_mreq_source * val = (void*)optval; + struct in_addr temp_addr = val->imr_sourceaddr; + val->imr_sourceaddr = val->imr_interface; + val->imr_interface = temp_addr; + + convert_sockopt(&level, &optname); + break; + } case WS_IP_ADD_MEMBERSHIP: case WS_IP_DROP_MEMBERSHIP: #ifdef IP_HDRINCL -- 2.23.0
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=57961
Your paranoid android.
=== debian10 (32 bit report) ===
ws2_32: sock.c:3058: Test succeeded inside todo block: Test[1]: expected 0, got 0 sock.c:3058: Test succeeded inside todo block: Test[1]: expected 0, got 0 sock.c:3058: Test succeeded inside todo block: Test[1]: expected 0, got 0 sock.c:3058: Test succeeded inside todo block: Test[2]: expected 0, got 0
On Fri, 2019-10-18 at 15:27 +0200, Fabian Maurer wrote:
@@ -6011,6 +6015,20 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, case WS_IPPROTO_IP: switch(optname) {
case WS_IP_ADD_SOURCE_MEMBERSHIP:
case WS_IP_DROP_SOURCE_MEMBERSHIP:
case WS_IP_BLOCK_SOURCE:
case WS_IP_UNBLOCK_SOURCE:
{
/* ip_mreq_source is different on Windows, we need to switch source and interface */
struct ip_mreq_source * val = (void*)optval;
struct in_addr temp_addr = val->imr_sourceaddr;
val->imr_sourceaddr = val->imr_interface;
val->imr_interface = temp_addr;
You are modifying a structure owned by the caller. Look at how we build a local copy for WS_SO_LINGER, for example.
You are modifying a structure owned by the caller. Look at how we build a local copy for WS_SO_LINGER, for example.
Thanks, I overlooked this aspect, you're completely right. I'll send in a new patch.
Regards, Fabian Maurer