]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix "address.GetPort() != 0" assertion for helpers on FreeBSD (at least).
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 22 Jan 2013 11:06:18 +0000 (04:06 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jan 2013 11:06:18 +0000 (04:06 -0700)
The order (or set of?) #include files used by src/ssl/helper.cc (and
probably by other helper source files) has changed recently, exposing a
defines.h dependency on sys/socket.h where that system header is
required to define AF_UNIX. With AF_UNIX incorrectly undefined,
IPC_STREAM was set to IPC_TCP_SOCKET instead of IPC_UNIX_STREAM, and
helpers that do not have a notion of a listening port, were trying to
create communication sockets using TCP streams, triggering a "must have
a port" assertion in comm_connect_addr() called from ipcCreate().

TODO: Moving IPC_* defines into an IPC-specific header file may be a
better solution then exposing all defines.h users to sys/socket.h.

src/defines.h

index 3c42025742e4a4550ffb86bce9c071ee28522dc8..1828701ddd7d425705ce1ee21400f24d5ab64b58 100644 (file)
 
 /* required for AF_UNIX below to be defined [on FreeBSD] */
 #if HAVE_SYS_SOCKET_H
-#include <sys/socket.h> 
+#include <sys/socket.h>
 #endif
 
 #if HAVE_SOCKETPAIR && defined (AF_UNIX)