From 9dd44ba5d672883a45f2dd9f715d3910b52fe941 Mon Sep 17 00:00:00 2001 From: Joris Dedieu Date: Sat, 13 Jun 2015 01:05:11 +0200 Subject: [PATCH] BUG/MEDIUM: compat: fix segfault on FreeBSD Since commit 65d805fd witch removes standard.h from compat.h some values were not properly set on FreeBSD. This caused a segfault at startup when smp_resolve_args is called. As FreeBSD have IP_BINDANY, CONFIG_HAP_TRANSPARENT is define. This cause struct conn_src to be extended with some fields. The size of this structure was incorrect. Including netinet/in.h fix this issue. While diving in code preprocessing, I found that limits.h was require to properly set MAX_HOSTNAME_LEN, ULONG_MAX, USHRT_MAX and others system limits on FreeBSD. --- include/common/compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/common/compat.h b/include/common/compat.h index ecbc3b1164..07dd01d8c1 100644 --- a/include/common/compat.h +++ b/include/common/compat.h @@ -22,11 +22,13 @@ #ifndef _COMMON_COMPAT_H #define _COMMON_COMPAT_H +#include /* This is needed on Linux for Netfilter includes */ #include #include #include #include +#include #ifndef BITS_PER_INT #define BITS_PER_INT (8*sizeof(int))