From cf3f6403bccfba1d0f1ea97886a1f1bf2bebea16 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Mon, 12 Jan 2015 20:24:29 +0100 Subject: [PATCH] Corrected some configure --disable --- CHANGES | 4 ++++ compat.h | 4 +++- hostan.c | 4 ++-- xio.h | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index ede6660..9ed68b3 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,10 @@ corrections: to a random port instead of terminating with error. Test: TCP4_NOPORT + configure with some combination of disable options produced config + files that failed to compile due to missing IPPROTO_TCP. + Thanks to Thierry Fournier for report and patch. + porting: Socat included instead of POSIX Thanks to John Spencer for reporting this issue. diff --git a/compat.h b/compat.h index 541d3d8..d2cc489 100644 --- a/compat.h +++ b/compat.h @@ -76,7 +76,9 @@ typedef int sig_atomic_t; /* SOL_TCP: AIX 4.3.3 */ #ifndef SOL_TCP -# define SOL_TCP IPPROTO_TCP +# ifdef IPPROTO_TCP +# define SOL_TCP IPPROTO_TCP +# endif #endif /* POSIX.1 doesn't seem to know sockets */ diff --git a/hostan.c b/hostan.c index d1e9bf5..341249f 100644 --- a/hostan.c +++ b/hostan.c @@ -38,14 +38,14 @@ int hostan(FILE *outfile) { fprintf(outfile, "((struct diag_dgram *)0)->now-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->now)-(char *)((struct diag_dgram *)0))); fprintf(outfile, "((struct diag_dgram *)0)->exitcode-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->exitcode)-(char *)((struct diag_dgram *)0))); fprintf(outfile, "((struct diag_dgram *)0)->text-((struct diag_dgram *)0) = %u\n", (unsigned int)((((struct diag_dgram *)0)->text)-(char *)((struct diag_dgram *)0))); -#if _WITH_SOCKET +#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) fprintf(outfile, "\nIP INTERFACES\n"); iffan(outfile); #endif return 0; } -#if _WITH_SOCKET +#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) static int iffan(FILE *outfile) { /* Linux: man 7 netdevice */ /* FreeBSD, NetBSD: man 4 networking */ diff --git a/xio.h b/xio.h index a30596e..f050773 100644 --- a/xio.h +++ b/xio.h @@ -1,5 +1,5 @@ /* source: xio.h */ -/* Copyright Gerhard Rieger 2001-2011 */ +/* Copyright Gerhard Rieger */ /* Published under the GNU General Public License V.2, see file COPYING */ #ifndef __xio_h_included @@ -200,11 +200,13 @@ typedef struct single { char *hosts_deny_table; #endif } ip; +#endif /* _WITH_IP4 || _WITH_IP6 */ +#if WITH_UNIX struct { bool tight; } un; -#endif /* _WITH_IP4 || _WITH_IP6 */ } socket; +#endif /* WITH_UNIX */ #endif /* _WITH_SOCKET */ struct { pid_t pid; /* child PID, with EXEC: */