From: Pavel Shramov Date: Tue, 4 Dec 2007 14:43:35 +0000 (+0300) Subject: network plugin: Fix setsockopt for SO_REUSEADDR since value of loop variable changed X-Git-Tag: collectd-4.3.0beta0~70^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a9a66142bb0e97bd8c9563cd33e0e489a5f16f36;p=collectd.git network plugin: Fix setsockopt for SO_REUSEADDR since value of loop variable changed Signed-off-by: Florian Forster --- diff --git a/src/network.c b/src/network.c index ab04f4c1..a659189f 100644 --- a/src/network.c +++ b/src/network.c @@ -682,10 +682,11 @@ static int network_set_ttl (const sockent_t *se, const struct addrinfo *ai) static int network_bind_socket (const sockent_t *se, const struct addrinfo *ai) { int loop = 0; + int yes = 1; /* allow multiple sockets to use the same PORT number */ if (setsockopt(se->fd, SOL_SOCKET, SO_REUSEADDR, - &loop, sizeof(loop)) == -1) { + &yes, sizeof(yes)) == -1) { char errbuf[1024]; ERROR ("setsockopt: %s", sstrerror (errno, errbuf, sizeof (errbuf)));