1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-06-18 06:46:51 +00:00

Option ip-add-source-membership did not work

This commit is contained in:
Gerhard Rieger 2024-12-27 13:00:22 +01:00
parent 9beffd3193
commit bcca5a3b9a
2 changed files with 6 additions and 2 deletions

View file

@ -29,6 +29,10 @@ Corrections:
or to undefined behaviour before terminating Socat with addresses EXEC, or to undefined behaviour before terminating Socat with addresses EXEC,
SYSTEM, or SHELL. SYSTEM, or SHELL.
Option ip-add-source-membership did not work.
Thanks to Duncan Sands and others for reporting this issue and sending
the fix.
Building: Building:
Disabling certain features during configure could break build process. Disabling certain features during configure could break build process.

View file

@ -1355,7 +1355,7 @@ int xioapply_ip_add_source_membership(struct single *sfd, struct opt *opt) {
} }
ip4_mreq_src.imr_multiaddr = sockaddr1.ip4.sin_addr; ip4_mreq_src.imr_multiaddr = sockaddr1.ip4.sin_addr;
/* second parameter is interface address */ /* second parameter is interface address */
rc = xioresolve(opt->value.u_string/*ifaddr*/, NULL, rc = xioresolve(opt->value2.u_string/*ifaddr*/, NULL,
sfd->para.socket.la.soa.sa_family, sfd->para.socket.la.soa.sa_family,
SOCK_DGRAM, IPPROTO_IP, SOCK_DGRAM, IPPROTO_IP,
&sockaddr2, &socklen2, sfd->para.socket.ip.ai_flags); &sockaddr2, &socklen2, sfd->para.socket.ip.ai_flags);
@ -1364,7 +1364,7 @@ int xioapply_ip_add_source_membership(struct single *sfd, struct opt *opt) {
} }
ip4_mreq_src.imr_interface = sockaddr2.ip4.sin_addr; ip4_mreq_src.imr_interface = sockaddr2.ip4.sin_addr;
/* third parameter is source address */ /* third parameter is source address */
rc = xioresolve(opt->value.u_string/*srcaddr*/, NULL, rc = xioresolve(opt->value3.u_string/*srcaddr*/, NULL,
sfd->para.socket.la.soa.sa_family, sfd->para.socket.la.soa.sa_family,
SOCK_DGRAM, IPPROTO_IP, SOCK_DGRAM, IPPROTO_IP,
&sockaddr3, &socklen3, sfd->para.socket.ip.ai_flags); &sockaddr3, &socklen3, sfd->para.socket.ip.ai_flags);