mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 15:32:35 +00:00
Again ported to NetBSD
This commit is contained in:
parent
b5b9ee0031
commit
2ab4b232fc
6 changed files with 43 additions and 3 deletions
3
CHANGES
3
CHANGES
|
@ -3,6 +3,9 @@ Features:
|
||||||
Total inactivity timeout option -T 0 now means 0.0 seconds; up to
|
Total inactivity timeout option -T 0 now means 0.0 seconds; up to
|
||||||
version 1.8.0.0 it meant no total inactivity timeout.
|
version 1.8.0.0 it meant no total inactivity timeout.
|
||||||
|
|
||||||
|
Porting:
|
||||||
|
Changes for building and testing on NetBSD
|
||||||
|
|
||||||
Testing:
|
Testing:
|
||||||
test.sh: lots of corrections and improvements
|
test.sh: lots of corrections and improvements
|
||||||
|
|
||||||
|
|
10
configure.ac
10
configure.ac
|
@ -305,6 +305,16 @@ if test "$ac_cv_apple_use_rfc_2292" = yes; then
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_apple_use_rfc_2292)
|
AC_MSG_RESULT($ac_cv_apple_use_rfc_2292)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(if including netinet/in.h suffices)
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <netinet/in.h>],
|
||||||
|
[struct sockaddr_in6 s;],
|
||||||
|
[ AC_MSG_RESULT(yes); WITH_IP6=1],
|
||||||
|
[ AC_MSG_RESULT(no); WITH_IP6=])
|
||||||
|
if test "$WITH_IP6"; then
|
||||||
|
AC_DEFINE(WITH_IP6)
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING(whether to include raw IP support)
|
AC_MSG_CHECKING(whether to include raw IP support)
|
||||||
|
|
17
utils.c
17
utils.c
|
@ -38,6 +38,23 @@ void *memdup(const void *src, size_t n) {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !HAVE_PROTOTYPE_LIB_strndup
|
||||||
|
char *strndup(
|
||||||
|
const char *s,
|
||||||
|
size_t n)
|
||||||
|
{
|
||||||
|
char *m;
|
||||||
|
m = malloc(n+1);
|
||||||
|
if (m == NULL) {
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
strncpy(m, s, n);
|
||||||
|
m[n] = '\0';
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
#endif /* !HAVE_PROTOTYPE_LIB_strndup */
|
||||||
|
|
||||||
|
|
||||||
/* search the keyword-table for a match of the leading part of name. */
|
/* search the keyword-table for a match of the leading part of name. */
|
||||||
/* returns the pointer to the matching field of the keyword or NULL if no
|
/* returns the pointer to the matching field of the keyword or NULL if no
|
||||||
keyword was found. */
|
keyword was found. */
|
||||||
|
|
3
utils.h
3
utils.h
|
@ -15,6 +15,9 @@ struct wordent {
|
||||||
extern void *memrchr(const void *s, int c, size_t n);
|
extern void *memrchr(const void *s, int c, size_t n);
|
||||||
#endif
|
#endif
|
||||||
extern void *memdup(const void *src, size_t n);
|
extern void *memdup(const void *src, size_t n);
|
||||||
|
#if !HAVE_PROTOTYPE_LIB_strndup
|
||||||
|
extern char *strndup(const char *s, size_t n);
|
||||||
|
#endif
|
||||||
#if !HAVE_SETENV
|
#if !HAVE_SETENV
|
||||||
extern int setenv(const char *name, const char *value, int overwrite);
|
extern int setenv(const char *name, const char *value, int overwrite);
|
||||||
#endif /* !HAVE_SETENV */
|
#endif /* !HAVE_SETENV */
|
||||||
|
|
4
xio-ip.c
4
xio-ip.c
|
@ -216,9 +216,11 @@ int xiogetaddrinfo(const char *node, const char *service,
|
||||||
if (family == PF_UNSPEC) family = PF_INET6;
|
if (family == PF_UNSPEC) family = PF_INET6;
|
||||||
#endif /* WITH_IP6 */
|
#endif /* WITH_IP6 */
|
||||||
}
|
}
|
||||||
|
#if HAVE_GETADDRINFO
|
||||||
|
#ifdef AI_ADDRCONFIG
|
||||||
if (family == 0)
|
if (family == 0)
|
||||||
hints.ai_flags |= AI_ADDRCONFIG;
|
hints.ai_flags |= AI_ADDRCONFIG;
|
||||||
#if HAVE_GETADDRINFO
|
#endif
|
||||||
if (node != NULL || service != NULL) {
|
if (node != NULL || service != NULL) {
|
||||||
struct addrinfo *record;
|
struct addrinfo *record;
|
||||||
|
|
||||||
|
|
|
@ -1121,7 +1121,7 @@ int
|
||||||
#elif HAVE_DTLSv1_client_method
|
#elif HAVE_DTLSv1_client_method
|
||||||
method = sycDTLSv1_client_method();
|
method = sycDTLSv1_client_method();
|
||||||
#else
|
#else
|
||||||
# error "OpenSSL does not seem to provide DTLS client methods"
|
# warning "OpenSSL does not seem to provide DTLS client methods"
|
||||||
#endif
|
#endif
|
||||||
*use_dtls = true;
|
*use_dtls = true;
|
||||||
}
|
}
|
||||||
|
@ -1192,12 +1192,17 @@ int
|
||||||
#elif HAVE_DTLSv1_server_method
|
#elif HAVE_DTLSv1_server_method
|
||||||
method = sycDTLSv1_server_method();
|
method = sycDTLSv1_server_method();
|
||||||
#else
|
#else
|
||||||
# error "OpenSSL does not seem to provide DTLS server methods"
|
# warning "OpenSSL does not seem to provide DTLS server methods"
|
||||||
#endif
|
#endif
|
||||||
*use_dtls = true;
|
*use_dtls = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (method == NULL) {
|
||||||
|
Error("no OpenSSL method available");
|
||||||
|
return STAT_NORETRY;
|
||||||
|
}
|
||||||
|
|
||||||
if (opt_egd) {
|
if (opt_egd) {
|
||||||
#if !defined(OPENSSL_NO_EGD) && HAVE_RAND_egd
|
#if !defined(OPENSSL_NO_EGD) && HAVE_RAND_egd
|
||||||
sycRAND_egd(opt_egd);
|
sycRAND_egd(opt_egd);
|
||||||
|
|
Loading…
Reference in a new issue