From: Fabian Maurer Subject: [PATCH] ws2_32: Handle more IGMP socket options Message-Id: <20191018132708.44176-1-dark.shadow4@web.de> Date: Fri, 18 Oct 2019 15:27:08 +0200 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47956 Signed-off-by: Fabian Maurer --- 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