TCP_Check() compatibility for NetBSD

Daniel Bilik daniel.bilik at
Wed Apr 13 12:15:42 CEST 2011


Macro TCP_Check() as defined in include/libvarnish.h has two variants -
for Solaris and the rest of world. There is a note that EINVAL for socket
reset by the remote is a bug in Solaris. Well, I see the same on NetBSD
(5.1), where this is documented behaviour (ie. not a bug) - getsockname(2)
explicitly says:

[EINVAL]           The socket has been shut down.

This causes varnishd to panic approx. once a day on my NetBSD box with
messages like this:

varnishd[27350]: Child (25744) Panic message: Assert error in
VRT_r_server_ip(), cache_vrt.c line 768:   Condition(TCP_Check(i)) not
true. errno = 22 (Invalid argument)

It can be fixed by simply extending the condition for macro definition, see
attached patch.

						Daniel Bilik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnish-2.1.5.patch
Type: text/x-diff
Size: 644 bytes
Desc: not available
URL: <>

More information about the varnish-bugs mailing list