<div dir="ltr">And a version aligned with phk's comment (off by default).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 4, 2015 at 12:15 AM, Federico Schwindt <span dir="ltr"><<a href="mailto:fgsch@lodoss.net" target="_blank">fgsch@lodoss.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br>Actually the problem is somewhere else.<br><br></div><div>The attached diff should fix it.<br><br></div><div>Cheers.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 2, 2015 at 10:23 PM, Rafael Zalamena <span dir="ltr"><<a href="mailto:rafaelfz@taghos.com.br" target="_blank">rafaelfz@taghos.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Varnish cache daemon is not doing 'accept_filter' for the GNU/Linux<br>
version because of HAVE_ACCEPT_FILTER not being defined. Something along<br>
the way broke it, so in order to fix it I have added TCP_DEFER_ACCEPT<br>
detection code to <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> to define HAVE_ACCEPT_FILTER and<br>
HAVE_TCP_DEFER_ACCEPT so we can have a fallback of accept_filter on Linux.<br>
<br>
Since I didn't see any different use of ACCEPT_FILTER and historicaly no<br>
one used it diferently I kept TCP_DEFER_ACCEPT being a ACCEPT_FILTER<br>
replacement to create a small diff.<br>
<br>
diff --git <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index 6c4d5f2..4a50fd8 100644<br>
--- <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER],<br>
     ]<br>
 )<br>
<br>
+AC_CHECK_DECL([TCP_DEFER_ACCEPT],<br>
+    [<br>
+    AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept filters]),<br>
+    AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer accept])<br>
+    ],<br>
+    ,<br>
+    [<br>
+#include <sys/socket.h><br>
+#include <netinet/in.h><br>
+#include <netinet/tcp.h><br>
+    ]<br>
+)<br>
+<br>
 # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not<br>
 # implement them.<br>
 #<br>
diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c<br>
index 3992555..732c2ea 100644<br>
--- lib/libvarnish/vtcp.c<br>
+++ lib/libvarnish/vtcp.c<br>
@@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen)<br>
 /*--------------------------------------------------------------------*/<br>
<br>
 #ifdef HAVE_ACCEPT_FILTERS<br>
+#ifndef HAVE_TCP_DEFER_ACCEPT<br>
<br>
 int<br>
 VTCP_filter_http(int sock)<br>
@@ -160,7 +161,7 @@ VTCP_filter_http(int sock)<br>
        return (retval);<br>
 }<br>
<br>
-#elif defined(__linux)<br>
+#else /* HAVE_TCP_DEFER_ACCEPT */<br>
<br>
 int<br>
 VTCP_filter_http(int sock)<br>
@@ -173,6 +174,7 @@ VTCP_filter_http(int sock)<br>
        return (retval);<br>
 }<br>
<br>
+#endif<br>
 #else<br>
<br>
 int<br>
<br>
_______________________________________________<br>
varnish-dev mailing list<br>
<a href="mailto:varnish-dev@varnish-cache.org" target="_blank">varnish-dev@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>