From a48af2e226dcd7f61cc05b110f759449076f86e5 Mon Sep 17 00:00:00 2001 From: Roberto De Ioris Date: Sun, 11 Nov 2012 19:07:28 +0100 Subject: [PATCH] workaround missing IP_FREEBIND --- core/socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/socket.c b/core/socket.c index 9bab6e0e..862dc701 100644 --- a/core/socket.c +++ b/core/socket.c @@ -564,14 +564,15 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) { } #ifdef __linux__ -#ifdef IP_FREEBIND +#ifndef IP_FREEBIND +#define IP_FREEBIND 15 +#endif if (uwsgi.freebind) { if (setsockopt(serverfd, SOL_IP, IP_FREEBIND, (const void *) &uwsgi.freebind, sizeof(int)) < 0) { uwsgi_error("IP_FREEBIND setsockopt()"); uwsgi_nuclear_blast(); } } -#endif #endif if (uwsgi.reuse_port) {