Date: Mon, 22 Feb 2016 16:54:18 +0900 From: Hajimu UMEMOTO <ume@FreeBSD.org> To: bofh@FreeBSD.org Cc: Hajimu UMEMOTO <ume@FreeBSD.org> Subject: TCP_FASTOPEN is not available by default Message-ID: <ygevb5hp4d1.wl-ume@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
--Multipart_Mon_Feb_22_16:54:18_2016-1 Content-Type: text/plain; charset=US-ASCII Hi, I was disturbed by the problem that the vboxwebsrv was not work on recent 10.2-STABLE. It didn't listen on any ports. The vboxwebsrv is shipped with Virtualbox and it provide a web interface. I tracked this problem down and found that the gsoap is trying to use TCP_FASTOPEN then failed. TCP_FASTOPEN was MFC'ed recently to stable/10 without enabling it in the kernel build by default. However, TCP_FASTOPEN is defined in tcp.h. So, the gsoap tries to use it then fail. I've attached the patch for workaround. It makes gsoap to ignore the error from setsockopt(TCP_FASTOPEN). Sincerely, --Multipart_Mon_Feb_22_16:54:18_2016-1 Content-Type: text/x-patch; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="gsoap-fastopen.diff" Content-Transfer-Encoding: 7bit Index: files/patch-gsoap_stdsoap2.c =================================================================== --- files/patch-gsoap_stdsoap2.c (revision 409317) +++ files/patch-gsoap_stdsoap2.c (working copy) @@ -1,6 +1,6 @@ --- gsoap/stdsoap2.c.orig 2015-12-07 03:15:27 UTC +++ gsoap/stdsoap2.c -@@ -5194,6 +5194,11 @@ soap_bind(struct soap *soap, const char +@@ -5194,10 +5194,17 @@ soap_bind(struct soap *soap, const char } #endif #ifdef TCP_FASTOPEN @@ -12,3 +12,9 @@ if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, SOL_TCP, TCP_FASTOPEN, (char*)&set, sizeof(int))) { soap->errnum = soap_socket_errno(soap->master); soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_FASTOPEN failed in soap_bind()", SOAP_TCP_ERROR); ++#ifndef __FreeBSD__ + return SOAP_INVALID_SOCKET; ++#endif + } + #endif + #endif Index: files/patch-gsoap_stdsoap2.cpp =================================================================== --- files/patch-gsoap_stdsoap2.cpp (revision 409317) +++ files/patch-gsoap_stdsoap2.cpp (working copy) @@ -1,6 +1,6 @@ ---- gsoap/stdsoap2.cpp.orig 2016-01-01 16:24:55 UTC +--- gsoap/stdsoap2.cpp.orig 2015-12-07 03:15:27 UTC +++ gsoap/stdsoap2.cpp -@@ -5194,6 +5194,10 @@ soap_bind(struct soap *soap, const char +@@ -5194,10 +5194,16 @@ soap_bind(struct soap *soap, const char } #endif #ifdef TCP_FASTOPEN @@ -11,3 +11,9 @@ if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, SOL_TCP, TCP_FASTOPEN, (char*)&set, sizeof(int))) { soap->errnum = soap_socket_errno(soap->master); soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_FASTOPEN failed in soap_bind()", SOAP_TCP_ERROR); ++#ifndef __FreeBSD__ + return SOAP_INVALID_SOCKET; ++#endif + } + #endif + #endif --Multipart_Mon_Feb_22_16:54:18_2016-1 Content-Type: text/plain; charset=US-ASCII -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ --Multipart_Mon_Feb_22_16:54:18_2016-1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygevb5hp4d1.wl-ume>