]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: build: rename some build macros to use the USE_* ones
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 17:24:06 +0000 (19:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 17:47:57 +0000 (19:47 +0200)
We still have quite a number of build macros which are mapped 1:1 to a
USE_something setting in the makefile but which have a different name.
This patch cleans this up by renaming them to use the USE_something
one, allowing to clean up the makefile and make it more obvious when
reading the code what build option needs to be added.

The following renames were done :

 ENABLE_POLL -> USE_POLL
 ENABLE_EPOLL -> USE_EPOLL
 ENABLE_KQUEUE -> USE_KQUEUE
 ENABLE_EVPORTS -> USE_EVPORTS
 TPROXY -> USE_TPROXY
 NETFILTER -> USE_NETFILTER
 NEED_CRYPT_H -> USE_CRYPT_H
 CONFIG_HAP_CRYPT -> USE_LIBCRYPT
 CONFIG_HAP_NS -> DUSE_NS
 CONFIG_HAP_LINUX_SPLICE -> USE_LINUX_SPLICE
 CONFIG_HAP_LINUX_TPROXY -> USE_LINUX_TPROXY
 CONFIG_HAP_LINUX_VSYSCALL -> USE_LINUX_VSYSCALL

19 files changed:
Makefile
include/common/accept4.h
include/common/compat.h
include/common/epoll.h
include/common/namespace.h
include/common/splice.h
src/auth.c
src/cfgparse-listen.c
src/cfgparse.c
src/cli.c
src/connection.c
src/fd.c
src/haproxy.c
src/mux_h1.c
src/mux_pt.c
src/proto_tcp.c
src/proxy.c
src/raw_sock.c
src/server.c

index f6cd6a5bb433d042357dae9514f9418579e6430e..a0e3bb32cce9799da38d107e617eee814f0b775c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -464,27 +464,10 @@ BUILD_FEATURES := $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if $(USE_$(opt
 # possibly be unused though)
 OPTIONS_CFLAGS += $(foreach opt,$(use_opts),$(if $($(opt)),-D$(opt),))
 
-ifneq ($(USE_LINUX_SPLICE),)
-OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_SPLICE
-endif
-
-ifneq ($(USE_TPROXY),)
-OPTIONS_CFLAGS += -DTPROXY
-endif
-
-ifneq ($(USE_LINUX_TPROXY),)
-OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_TPROXY
-endif
-
 ifneq ($(USE_LIBCRYPT),)
-OPTIONS_CFLAGS  += -DCONFIG_HAP_CRYPT
 OPTIONS_LDFLAGS += -lcrypt
 endif
 
-ifneq ($(USE_CRYPT_H),)
-OPTIONS_CFLAGS  += -DNEED_CRYPT_H
-endif
-
 ifneq ($(USE_SLZ),)
 # Use SLZ_INC and SLZ_LIB to force path to zlib.h and libz.{a,so} if needed.
 SLZ_INC =
@@ -502,38 +485,29 @@ OPTIONS_LDFLAGS += $(if $(ZLIB_LIB),-L$(ZLIB_LIB)) -lz
 endif
 
 ifneq ($(USE_POLL),)
-OPTIONS_CFLAGS += -DENABLE_POLL
 OPTIONS_OBJS   += src/ev_poll.o
 endif
 
 ifneq ($(USE_EPOLL),)
-OPTIONS_CFLAGS += -DENABLE_EPOLL
 OPTIONS_OBJS   += src/ev_epoll.o
 endif
 
 ifneq ($(USE_KQUEUE),)
-OPTIONS_CFLAGS += -DENABLE_KQUEUE
 OPTIONS_OBJS   += src/ev_kqueue.o
 endif
 
 ifneq ($(USE_EVPORTS),)
-OPTIONS_CFLAGS += -DENABLE_EVPORTS
 OPTIONS_OBJS   += src/ev_evports.o
 endif
 
 ifneq ($(USE_VSYSCALL),)
 OPTIONS_OBJS   += src/i386-linux-vsys.o
-OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_VSYSCALL
 endif
 
 ifneq ($(ASSUME_SPLICE_WORKS),)
 OPTIONS_CFLAGS += -DASSUME_SPLICE_WORKS
 endif
 
-ifneq ($(USE_NETFILTER),)
-OPTIONS_CFLAGS += -DNETFILTER
-endif
-
 ifneq ($(USE_REGPARM),)
 OPTIONS_CFLAGS += -DCONFIG_REGPARM=3
 endif
@@ -755,7 +729,6 @@ COPTS += -finstrument-functions
 endif
 
 ifneq ($(USE_NS),)
-OPTIONS_CFLAGS += -DCONFIG_HAP_NS
 OPTIONS_OBJS  += src/namespace.o
 endif
 
index 8981b92e3bb0c0a6d629e6572b5f063a2f8c842e..73042136942b9371763a98f1462df1408cd3beb3 100644 (file)
@@ -42,7 +42,7 @@
 #endif
 
 #if defined(USE_MY_ACCEPT4) || (!defined(SYS_ACCEPT4) && !defined(__NR_accept4))
-#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
+#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
 /* The syscall is redefined somewhere else */
 extern int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
 #elif ACCEPT4_USE_SOCKETCALL
index 088b2c9b217d6f5fb1677b3b41a5883ad77a5bf6..14996c8d85f831200ae811959e35c91c944c5a39 100644 (file)
@@ -90,7 +90,7 @@ typedef struct { } empty_t;
 /* On Linux 2.4 and above, MSG_TRUNC can be used on TCP sockets to drop any
  * pending data. Let's rely on NETFILTER to detect if this is supported.
  */
-#ifdef NETFILTER
+#ifdef USE_NETFILTER
 #define MSG_TRUNC_CLEARS_INPUT
 #endif
 
@@ -117,14 +117,14 @@ typedef struct { } empty_t;
 #define TIMER_INVALID ((timer_t)(unsigned long)(0xfffffffful))
 #endif
 
-#if defined(TPROXY) && defined(NETFILTER)
+#if defined(USE_TPROXY) && defined(USE_NETFILTER)
 #include <linux/types.h>
 #include <linux/netfilter_ipv6.h>
 #include <linux/netfilter_ipv4.h>
 #endif
 
 /* On Linux, IP_TRANSPARENT and/or IP_FREEBIND generally require a kernel patch */
-#if defined(CONFIG_HAP_LINUX_TPROXY)
+#if defined(USE_LINUX_TPROXY)
 #if !defined(IP_FREEBIND)
 #define IP_FREEBIND 15
 #endif /* !IP_FREEBIND */
@@ -134,7 +134,7 @@ typedef struct { } empty_t;
 #if !defined(IPV6_TRANSPARENT)
 #define IPV6_TRANSPARENT 75
 #endif /* !IPV6_TRANSPARENT */
-#endif /* CONFIG_HAP_LINUX_TPROXY */
+#endif /* USE_LINUX_TPROXY */
 
 #if defined(IP_FREEBIND)       \
  || defined(IP_BINDANY)        \
@@ -148,9 +148,9 @@ typedef struct { } empty_t;
 /* We'll try to enable SO_REUSEPORT on Linux 2.4 and 2.6 if not defined.
  * There are two families of values depending on the architecture. Those
  * are at least valid on Linux 2.4 and 2.6, reason why we'll rely on the
- * NETFILTER define.
+ * USE_NETFILTER define.
  */
-#if !defined(SO_REUSEPORT) && defined(NETFILTER)
+#if !defined(SO_REUSEPORT) && defined(USE_NETFILTER)
 #if    (SO_REUSEADDR == 2)
 #define SO_REUSEPORT 15
 #elif  (SO_REUSEADDR == 0x0004)
index cc395cde0bd31c0a66cb8ede7d2067fd7959d866..f45aa4fa943829eb67f13a9bd72fd00326ae40ca 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef _COMMON_EPOLL_H
 #define _COMMON_EPOLL_H
 
-#if defined (__linux__) && defined(ENABLE_EPOLL)
+#if defined (__linux__) && defined(USE_EPOLL)
 
 #ifndef USE_MY_EPOLL
 #include <sys/epoll.h>
@@ -70,7 +70,7 @@ struct epoll_event {
        } data;
 };
 
-#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
+#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
 /* Those are our self-defined functions */
 extern int epoll_create(int size);
 extern int epoll_ctl(int epfd, int op, int fd, struct epoll_event * event);
@@ -94,7 +94,7 @@ static inline _syscall4 (int, epoll_wait, int, epfd, struct epoll_event *, event
 
 #endif /* USE_MY_EPOLL */
 
-#endif /* __linux__ && ENABLE_EPOLL */
+#endif /* __linux__ && USE_EPOLL */
 
 #endif /* _COMMON_EPOLL_H */
 
index 7aacff968170e38bab1d1e66f818b685a37649e8..41931ff6d3d935f6bd7fbce067f52d141e921da0 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdlib.h>
 #include <ebistree.h>
 
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
 
 struct netns_entry
 {
@@ -28,6 +28,6 @@ static inline int my_socketat(const struct netns_entry *ns, int domain, int type
        return socket(domain, type, protocol);
 }
 
-#endif /* CONFIG_HAP_NS */
+#endif /* USE_NS */
 
 #endif /* _NAMESPACE_H */
index ea29b1671c0a209c2bec87c2170fc5041436a186..760b6ba0d1741260b2bf93aabad8e5cbcfda90bb 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef _COMMON_SPLICE_H
 #define _COMMON_SPLICE_H
 
-#if defined (__linux__) && defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined (__linux__) && defined(USE_LINUX_SPLICE)
 
 #include <errno.h>
 #include <unistd.h>
@@ -49,7 +49,7 @@
 
 #if defined(USE_MY_SPLICE)
 
-#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
+#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
 /* The syscall is redefined somewhere else */
 extern int splice(int fdin, loff_t *off_in, int fdout, loff_t *off_out, size_t len, unsigned long flags);
 #else
@@ -71,7 +71,7 @@ static inline _syscall6(int, splice, int, fdin, loff_t *, off_in, int, fdout, lo
 
 #endif /* USE_MY_SPLICE */
 
-#endif /* __linux__ && CONFIG_HAP_LINUX_SPLICE */
+#endif /* __linux__ && USE_LINUX_SPLICE */
 
 #endif /* _COMMON_SPLICE_H */
 
index 8d1da3e3bb6500950ce28accacaddb362c1ec099..0232b569470116dcdbaccdd95f43ebed91ee4bae 100644 (file)
  *
  */
 
-#ifdef CONFIG_HAP_CRYPT
+#ifdef USE_LIBCRYPT
 /* This is to have crypt() defined on Linux */
 #define _GNU_SOURCE
 
-#ifdef NEED_CRYPT_H
+#ifdef USE_CRYPT_H
 /* some platforms such as Solaris need this */
 #include <crypt.h>
 #endif
-#endif /* CONFIG_HAP_CRYPT */
+#endif /* USE_LIBCRYPT */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -39,7 +39,7 @@
 
 struct userlist *userlist = NULL;    /* list of all existing userlists */
 
-#ifdef CONFIG_HAP_CRYPT
+#ifdef USE_LIBCRYPT
 #ifdef HA_HAVE_CRYPT_R
 /* context for crypt_r() */
 static THREAD_LOCAL struct crypt_data crypt_data = { .initialized = 0 };
@@ -256,7 +256,7 @@ check_user(struct userlist *ul, const char *user, const char *pass)
 #endif
 
        if (!(u->flags & AU_O_INSECURE)) {
-#ifdef CONFIG_HAP_CRYPT
+#ifdef USE_LIBCRYPT
 #ifdef HA_HAVE_CRYPT_R
                ep = crypt_r(pass, u->pass, &crypt_data);
 #else
index 9e2f44c14bf663ff6a9025d3b7313aaa80c44b8a..f96f1541c0dd881d48357368cfcce0df1ed85d2a 100644 (file)
@@ -3320,7 +3320,7 @@ stats_error_parsing:
                        goto out;
                }
        }
-#ifdef TPROXY
+#ifdef USE_TPROXY
        else if (!strcmp(args[0], "transparent")) {
                /* enable transparent proxy connections */
                curproxy->options |= PR_O_TRANSP;
index a16628a5c2d2c0dd3379b6b721910c48bff8d8d8..c8918a9e5bc389b31b72b7d77bfcf7a448c15be8 100644 (file)
  *
  */
 
-#ifdef CONFIG_HAP_CRYPT
+#ifdef USE_LIBCRYPT
 /* This is to have crypt() defined on Linux */
 #define _GNU_SOURCE
 
-#ifdef NEED_CRYPT_H
+#ifdef USE_CRYPT_H
 /* some platforms such as Solaris need this */
 #include <crypt.h>
 #endif
-#endif /* CONFIG_HAP_CRYPT */
+#endif /* USE_LIBCRYPT */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1505,7 +1505,7 @@ void free_email_alert(struct proxy *p)
 int
 cfg_parse_netns(const char *file, int linenum, char **args, int kwm)
 {
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
        const char *err;
        const char *item = args[0];
 
@@ -1701,7 +1701,7 @@ cfg_parse_users(const char *file, int linenum, char **args, int kwm)
 
                while (*args[cur_arg]) {
                        if (!strcmp(args[cur_arg], "password")) {
-#ifdef CONFIG_HAP_CRYPT
+#ifdef USE_LIBCRYPT
                                if (!crypt("", args[cur_arg + 1])) {
                                        ha_alert("parsing [%s:%d]: the encrypted password used for user '%s' is not supported by crypt(3).\n",
                                                 file, linenum, newuser->user);
index 23ab57b7330ea62176648acc1a007a059d370c4e..4b430a930a7602af4528c0d2ac3402d28ecf8ef0 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1654,7 +1654,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
                                memcpy(&tmpfd[i % MAX_SEND_FD], &l->fd, sizeof(l->fd));
                                if (!l->netns)
                                        tmpbuf[curoff++] = 0;
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
                                else {
                                        char *name = l->netns->node.key;
                                        unsigned char len = l->netns->name_len;
index 908d098e42a2ea82e68140cfbe893758edfdcd79..4b4a31482e5f150d42ade9e90497883246c0b1c7 100644 (file)
@@ -694,7 +694,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
                                                goto bad_header;
                                        break;
                                }
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
                                case PP2_TYPE_NETNS: {
                                        const struct netns_entry *ns;
                                        ns = netns_store_lookup((char*)tlv_packet->value, tlv_len);
@@ -1228,7 +1228,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
        }
 #endif
 
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
        if (remote && (remote->proxy_netns)) {
                if ((buf_len - ret) < sizeof(struct tlv))
                        return 0;
index d9241553939b155ea98b55a93d6f9915f501cd76..d87dddc2a5615a45c4c79c9a6c961b7ae7c6fa09 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
 #include <sys/types.h>
 #include <sys/resource.h>
 
-#if defined(ENABLE_POLL)
+#if defined(USE_POLL)
 #include <poll.h>
 #include <errno.h>
 #endif
@@ -477,7 +477,7 @@ void my_closefrom(int start)
        closefrom(start);
 }
 
-#elif defined(ENABLE_POLL)
+#elif defined(USE_POLL)
 /* This is a portable implementation of closefrom(). It closes all open file
  * descriptors starting at <start> and above. It relies on the fact that poll()
  * will return POLLNVAL for each invalid (hence close) file descriptor passed
@@ -534,7 +534,7 @@ void my_closefrom(int start)
        }
 }
 
-#else // defined(ENABLE_POLL)
+#else // defined(USE_POLL)
 
 /* This is a portable implementation of closefrom(). It closes all open file
  * descriptors starting at <start> and above. This is a naive version for use
@@ -556,7 +556,7 @@ void my_closefrom(int start)
        while (start < nbfds)
                close(start++);
 }
-#endif // defined(ENABLE_POLL)
+#endif // defined(USE_POLL)
 
 /* disable the specified poller */
 void disable_poller(const char *poller_name)
index 33b30b12c8e829fa51ca8443c276ad009240621b..306c34fa3bb24243628a1370dacdb424c890ee97 100644 (file)
@@ -502,19 +502,19 @@ static void usage(char *name)
                "        -N sets the default, per-proxy maximum # of connections (%d)\n"
                "        -L set local peer name (default to hostname)\n"
                "        -p writes pids of all children to this file\n"
-#if defined(ENABLE_EPOLL)
+#if defined(USE_EPOLL)
                "        -de disables epoll() usage even when available\n"
 #endif
-#if defined(ENABLE_KQUEUE)
+#if defined(USE_KQUEUE)
                "        -dk disables kqueue() usage even when available\n"
 #endif
-#if defined(ENABLE_EVPORTS)
+#if defined(USE_EVPORTS)
                "        -dv disables event ports usage even when available\n"
 #endif
-#if defined(ENABLE_POLL)
+#if defined(USE_POLL)
                "        -dp disables poll() usage even when available\n"
 #endif
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
                "        -dS disables splice usage (broken on old kernels)\n"
 #endif
 #if defined(USE_GETADDRINFO)
@@ -1394,19 +1394,19 @@ static void init(int argc, char **argv)
        vars_init(&global.vars, SCOPE_PROC);
 
        global.tune.options |= GTUNE_USE_SELECT;  /* select() is always available */
-#if defined(ENABLE_POLL)
+#if defined(USE_POLL)
        global.tune.options |= GTUNE_USE_POLL;
 #endif
-#if defined(ENABLE_EPOLL)
+#if defined(USE_EPOLL)
        global.tune.options |= GTUNE_USE_EPOLL;
 #endif
-#if defined(ENABLE_KQUEUE)
+#if defined(USE_KQUEUE)
        global.tune.options |= GTUNE_USE_KQUEUE;
 #endif
-#if defined(ENABLE_EVPORTS)
+#if defined(USE_EVPORTS)
        global.tune.options |= GTUNE_USE_EVPORTS;
 #endif
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
        global.tune.options |= GTUNE_USE_SPLICE;
 #endif
 #if defined(USE_GETADDRINFO)
@@ -1438,23 +1438,23 @@ static void init(int argc, char **argv)
                                        display_build_opts();
                                exit(0);
                        }
-#if defined(ENABLE_EPOLL)
+#if defined(USE_EPOLL)
                        else if (*flag == 'd' && flag[1] == 'e')
                                global.tune.options &= ~GTUNE_USE_EPOLL;
 #endif
-#if defined(ENABLE_POLL)
+#if defined(USE_POLL)
                        else if (*flag == 'd' && flag[1] == 'p')
                                global.tune.options &= ~GTUNE_USE_POLL;
 #endif
-#if defined(ENABLE_KQUEUE)
+#if defined(USE_KQUEUE)
                        else if (*flag == 'd' && flag[1] == 'k')
                                global.tune.options &= ~GTUNE_USE_KQUEUE;
 #endif
-#if defined(ENABLE_EVPORTS)
+#if defined(USE_EVPORTS)
                        else if (*flag == 'd' && flag[1] == 'v')
                                global.tune.options &= ~GTUNE_USE_EVPORTS;
 #endif
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
                        else if (*flag == 'd' && flag[1] == 'S')
                                global.tune.options &= ~GTUNE_USE_SPLICE;
 #endif
@@ -1770,7 +1770,7 @@ static void init(int argc, char **argv)
 #endif
        }
 
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
         err_code |= netns_init();
         if (err_code & (ERR_ABORT|ERR_FATAL)) {
                 ha_alert("Failed to initialize namespace support.\n");
index 918985e3ab5dfec0287813dfebc021c096a0d241..111e26295391e9426141112c89f20a61b2397ad9 100644 (file)
@@ -2273,7 +2273,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
        return total;
 }
 
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
 /* Send and get, using splicing */
 static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
 {
@@ -2379,7 +2379,7 @@ static const struct mux_ops mux_h1_ops = {
        .used_streams = h1_used_streams,
        .rcv_buf     = h1_rcv_buf,
        .snd_buf     = h1_snd_buf,
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
        .rcv_pipe    = h1_rcv_pipe,
        .snd_pipe    = h1_snd_pipe,
 #endif
index 18bc96ee83bd65c16f9f438b49f462cfb16263d1..1c1dd7f37db1147a0029e11f8c4cef6a26a24bfd 100644 (file)
@@ -297,7 +297,7 @@ static int mux_pt_unsubscribe(struct conn_stream *cs, int event_type, void *para
        return (cs->conn->xprt->unsubscribe(cs->conn, cs->conn->xprt_ctx, event_type, param));
 }
 
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
 /* Send and get, using splicing */
 static int mux_pt_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
 {
@@ -325,7 +325,7 @@ const struct mux_ops mux_pt_ops = {
        .snd_buf = mux_pt_snd_buf,
        .subscribe = mux_pt_subscribe,
        .unsubscribe = mux_pt_unsubscribe,
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
        .rcv_pipe = mux_pt_rcv_pipe,
        .snd_pipe = mux_pt_snd_pipe,
 #endif
index 95068ee6c4e333a92c2fb99ca12124d07246f415..f59502932dd1806d68bfd8419f4f0a1ff43c71bc 100644 (file)
@@ -246,7 +246,7 @@ static int create_server_socket(struct connection *conn)
 {
        const struct netns_entry *ns = NULL;
 
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
        if (objt_server(conn->target)) {
                if (__objt_server(conn->target)->flags & SRV_F_USE_NS_FROM_PP)
                        ns = conn->proxy_netns;
@@ -632,7 +632,7 @@ int tcp_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir)
                if (ret < 0)
                        return ret;
 
-#if defined(TPROXY) && defined(SO_ORIGINAL_DST)
+#if defined(USE_TPROXY) && defined(SO_ORIGINAL_DST)
                /* For TPROXY and Netfilter's NAT, we can retrieve the original
                 * IPv4 address before DNAT/REDIRECT. We must not do that with
                 * other families because v6-mapped IPv4 addresses are still
@@ -778,7 +778,7 @@ static int tcp_find_compatible_fd(struct listener *l)
                                    (xfer_sock->options & LI_MANDATORY_FLAGS)) {
                                        if ((xfer_sock->namespace == NULL &&
                                            l->netns == NULL)
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
                                            || (xfer_sock->namespace != NULL &&
                                            l->netns != NULL &&
                                            !strcmp(xfer_sock->namespace,
@@ -1862,7 +1862,7 @@ static int bind_parse_interface(char **args, int cur_arg, struct proxy *px, stru
 }
 #endif
 
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
 /* parse the "namespace" bind keyword */
 static int bind_parse_namespace(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
 {
@@ -1979,7 +1979,7 @@ static struct bind_kw_list bind_kws = { "TCP", { }, {
        { "v4v6",          bind_parse_v4v6,         0 }, /* force socket to bind to IPv4+IPv6 */
        { "v6only",        bind_parse_v6only,       0 }, /* force socket to bind to IPv6 only */
 #endif
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
        { "namespace",     bind_parse_namespace,    1 },
 #endif
        /* the versions with the NULL parse function*/
index 7b8e29450a16fe2a4aafdf68708def0723573f10..9fda6e2d1f53df93f8893dad280c4aa1138d7faf 100644 (file)
@@ -77,7 +77,7 @@ const struct cfg_opt cfg_opts[] =
        { "nolinger",     PR_O_TCP_NOLING, PR_CAP_FE | PR_CAP_BE, 0, 0 },
        { "persist",      PR_O_PERSIST,    PR_CAP_BE, 0, 0 },
        { "srvtcpka",     PR_O_TCP_SRV_KA, PR_CAP_BE, 0, 0 },
-#ifdef TPROXY
+#ifdef USE_TPROXY
        { "transparent",  PR_O_TRANSP,     PR_CAP_BE, 0, 0 },
 #else
        { "transparent",  0, 0, 0, 0 },
@@ -89,7 +89,7 @@ const struct cfg_opt cfg_opts[] =
 /* proxy->options2 */
 const struct cfg_opt cfg_opts2[] =
 {
-#ifdef CONFIG_HAP_LINUX_SPLICE
+#ifdef USE_LINUX_SPLICE
        { "splice-request",  PR_O2_SPLIC_REQ, PR_CAP_FE|PR_CAP_BE, 0, 0 },
        { "splice-response", PR_O2_SPLIC_RTR, PR_CAP_FE|PR_CAP_BE, 0, 0 },
        { "splice-auto",     PR_O2_SPLIC_AUT, PR_CAP_FE|PR_CAP_BE, 0, 0 },
index 6dde3f8755b46a5bdfb14673c228093fe81570f1..59a7cbc2fe6cac2d03411b5f8b907bc0fde518b7 100644 (file)
@@ -42,7 +42,7 @@
 #include <types/global.h>
 
 
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
 #include <common/splice.h>
 
 /* A pipe contains 16 segments max, and it's common to see segments of 1448 bytes
@@ -237,7 +237,7 @@ int raw_sock_from_pipe(struct connection *conn, void *xprt_ctx, struct pipe *pip
        return done;
 }
 
-#endif /* CONFIG_HAP_LINUX_SPLICE */
+#endif /* USE_LINUX_SPLICE */
 
 
 /* Receive up to <count> bytes from connection <conn>'s socket and store them
@@ -435,7 +435,7 @@ static struct xprt_ops raw_sock = {
        .rcv_buf  = raw_sock_to_buf,
        .subscribe = raw_sock_subscribe,
        .unsubscribe = raw_sock_unsubscribe,
-#if defined(CONFIG_HAP_LINUX_SPLICE)
+#if defined(USE_LINUX_SPLICE)
        .rcv_pipe = raw_sock_to_pipe,
        .snd_pipe = raw_sock_from_pipe,
 #endif
index b88ab30dfa81be08e8bfbee2d38cebf35c4179a7..52c71a6788ef60f54a2e0267b5a57f7f72e13f7a 100644 (file)
@@ -454,7 +454,7 @@ static int srv_parse_id(char **args, int *cur_arg, struct proxy *curproxy, struc
 static int srv_parse_namespace(char **args, int *cur_arg,
                                struct proxy *curproxy, struct server *newsrv, char **err)
 {
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
        char *arg;
 
        arg = args[*cur_arg + 1];