/* unused 0x0001 */
/* unused 0x0002 */
/* unused 0x0004 */
-#define LI_O_DEF_ACCEPT 0x0008 /* wait up to 1 second for data before accepting */
+/* unused 0x0008 */
#define LI_O_TCP_L4_RULES 0x0010 /* run TCP L4 rules checks on the incoming connection */
#define LI_O_TCP_L5_RULES 0x0020 /* run TCP L5 rules checks on the incoming session */
/* unused 0x0040 */
#define BC_O_USE_XPRT_STREAM 0x00000040 /* at least one stream-only xprt listener is used */
#define BC_O_NOLINGER 0x00000080 /* disable lingering on these listeners */
#define BC_O_NOQUICKACK 0x00000100 /* disable quick ack of immediate data (linux) */
+#define BC_O_DEF_ACCEPT 0x00000200 /* wait up to 1 second for data before accepting */
/* flags used with bind_conf->ssl_options */
/* parse the "defer-accept" bind keyword */
static int bind_parse_defer_accept(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
- struct listener *l;
-
- list_for_each_entry(l, &conf->listeners, by_bind) {
- if (l->rx.addr.ss_family == AF_INET || l->rx.addr.ss_family == AF_INET6)
- l->options |= LI_O_DEF_ACCEPT;
- }
-
+ conf->options |= BC_O_DEF_ACCEPT;
return 0;
}
#endif
sizeof(zero));
#endif
#if defined(TCP_DEFER_ACCEPT)
- if (listener->options & LI_O_DEF_ACCEPT) {
+ if (listener->bind_conf->options & BC_O_DEF_ACCEPT) {
/* defer accept by up to one second */
int accept_delay = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &accept_delay, sizeof(accept_delay)) == -1) {
#if !defined(TCP_DEFER_ACCEPT) && defined(SO_ACCEPTFILTER)
/* the socket needs to listen first */
- if (listener->options & LI_O_DEF_ACCEPT) {
+ if (listener->bind_conf->options & BC_O_DEF_ACCEPT) {
struct accept_filter_arg accept;
memset(&accept, 0, sizeof(accept));
strcpy(accept.af_name, "dataready");