Re: Compilation of haproxy-1.4-dev2 on FreeBSD

2009-08-26 Thread Willy Tarreau
Hello,

On Mon, Aug 24, 2009 at 03:11:06PM +0400, Dmitry Sivachenko wrote:
 Hello!
 
 Please consider the following patches. They are required to
 compile haproxy-1.4-dev2 on FreeBSD.
 
 Summary:
 1) include sys/types.h before netinet/tcp.h
 2) Use IPPROTO_TCP instead of SOL_TCP
 (they are both defined as 6, TCP protocol number)

Will apply it, thanks !

Regards,
Willy




Compilation of haproxy-1.4-dev2 on FreeBSD

2009-08-24 Thread Dmitry Sivachenko
Hello!

Please consider the following patches. They are required to
compile haproxy-1.4-dev2 on FreeBSD.

Summary:
1) include sys/types.h before netinet/tcp.h
2) Use IPPROTO_TCP instead of SOL_TCP
(they are both defined as 6, TCP protocol number)

Thanks!


--- src/backend.c.orig  2009-08-24 14:49:04.0 +0400
+++ src/backend.c   2009-08-24 14:49:19.0 +0400
@@ -17,6 +17,7 @@
 #include syslog.h
 #include string.h
 #include ctype.h
+#include sys/types.h
 
 #include netinet/tcp.h

--- src/stream_sock.c.orig  2009-08-24 14:45:15.0 +0400
+++ src/stream_sock.c   2009-08-24 14:46:19.0 +0400
@@ -16,12 +16,12 @@
 #include stdio.h
 #include stdlib.h
 
-#include netinet/tcp.h
-
 #include sys/socket.h
 #include sys/stat.h
 #include sys/types.h
 
+#include netinet/tcp.h
+
 #include common/compat.h
 #include common/config.h
 #include common/debug.h


--- src/proto_tcp.c.orig2009-08-24 14:50:03.0 +0400
+++ src/proto_tcp.c 2009-08-24 14:55:45.0 +0400
@@ -18,14 +18,14 @@
 #include string.h
 #include time.h
 
-#include netinet/tcp.h
-
 #include sys/param.h
 #include sys/socket.h
 #include sys/stat.h
 #include sys/types.h
 #include sys/un.h
 
+#include netinet/tcp.h
+
 #include common/cfgparse.h
 #include common/compat.h
 #include common/config.h
@@ -253,7 +253,7 @@ int tcp_bind_listener(struct listener *l
 #endif
 #ifdef TCP_MAXSEG
if (listener-maxseg) {
-   if (setsockopt(fd, SOL_TCP, TCP_MAXSEG,
+   if (setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG,
   listener-maxseg, sizeof(listener-maxseg)) == 
-1) {
msg = cannot set MSS;
err |= ERR_WARN;