Again fixes a few disable problems
diff --git a/CHANGES b/CHANGES
index 7f2af5d..d3b8a64 100644
--- a/CHANGES
+++ b/CHANGES
@@ -131,6 +131,8 @@
Building:
Disabling certain features during configure could break build process.
+ Again fixes a few disable problems.
+
Porting:
Fix for old FreeBSD.
diff --git a/xio-ipapp.c b/xio-ipapp.c
index d0c1871..eab2078 100644
--- a/xio-ipapp.c
+++ b/xio-ipapp.c
@@ -390,18 +390,22 @@
} else if (needbind && bindport) {
/* Bind by sourceport option */
switch ((*themp)->ai_family) {
+#if WITH_IP4
case PF_INET:
bindaddr.ip4.sin_family = (*themp)->ai_family;
bindaddr.ip4.sin_port = htons(bindport);
bindaddrp = &bindaddr;
bindlen = sizeof(bindaddr.ip4);
break;
+#endif
+#if WITH_IP6
case PF_INET6:
bindaddr.ip6.sin6_family = (*themp)->ai_family;
bindaddr.ip6.sin6_port = htons(bindport);
bindaddrp = &bindaddr;
bindlen = sizeof(bindaddr.ip6);
break;
+#endif
}
}
diff --git a/xio-socket.c b/xio-socket.c
index 8c0b3db..e2c0ab2 100644
--- a/xio-socket.c
+++ b/xio-socket.c
@@ -2349,11 +2349,13 @@
}
#endif /* WITH_TCP */
result = retropt_2integrals(opts, OPT_SO_REUSEADDR, &val, ¬null);
+#if WITH_TCP
if (ipproto == IPPROTO_TCP && result < 0) {
Info("Setting SO_REUSADDR on TCP listen socket implicitly");
val.u_int = 1;
notnull.u_bool = true;
}
+#endif /* WITH_TCP */
if (notnull.u_bool) {
if (Setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val.u_int, sizeof(int))
!= 0) {