From a69d01a277f48652481c161be3feea16e50d72eb Mon Sep 17 00:00:00 2001 From: trustchk Date: Thu, 2 Nov 2017 10:31:22 +0000 Subject: [PATCH] libcollectdclient: fix usage of ip_mreq On both IBM AIX and Gentoo Linux, the struct `ip_mreq` does not define the field `imr_address`, plus the compiler throws an error in the assignment of `sa->s_addr`. With `ip_mreqn` present, the fallback path for `ip_mreq` is not used and everything works. But AIX does not know that struct and fails to compile. --- src/libcollectdclient/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcollectdclient/server.c b/src/libcollectdclient/server.c index d18cc7da..a81afda8 100644 --- a/src/libcollectdclient/server.c +++ b/src/libcollectdclient/server.c @@ -82,7 +82,7 @@ static int server_multicast_join(lcc_listener_t *srv, }; #else struct ip_mreq mreq = { - .imr_address.s_addr = INADDR_ANY, .imr_multiaddr.s_addr = sa->s_addr, + .imr_multiaddr.s_addr = sa->sin_addr.s_addr, }; #endif status = setsockopt(srv->conn, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, -- 2.11.0