Packages: Update Kismet source

pull/6/head
Foxtrot 2019-07-07 16:17:22 +01:00
parent 134bfcf091
commit 359d19ffb0
5 changed files with 69 additions and 13 deletions

View File

@ -240,6 +240,9 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* strerror_r return type */
#undef STRERROR_R_T
/* system config directory */ /* system config directory */
#undef SYSCONF_LOC #undef SYSCONF_LOC

View File

@ -8719,6 +8719,49 @@ $as_echo "failed" >&6; }
fi fi
fi fi
# How do we do strerror?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r() return" >&5
$as_echo_n "checking for strerror_r() return... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
int
main ()
{
int r;
r = strerror_r(1, (char *) NULL, 0);
return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
strerror_r_int=yes
else
strerror_r_int=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$strerror_r_int" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5
$as_echo "int" >&6; }
$as_echo "#define STRERROR_R_T int" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: char *" >&5
$as_echo "char *" >&6; }
$as_echo "#define STRERROR_R_T char *" >>confdefs.h
fi
# How does accept() work on this system? # How does accept() work on this system?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept() addrlen type" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept() addrlen type" >&5
$as_echo_n "checking for accept() addrlen type... " >&6; } $as_echo_n "checking for accept() addrlen type... " >&6; }

View File

@ -456,6 +456,25 @@ if test "$stdint" = "no"; then
fi fi
fi fi
# How do we do strerror?
AC_MSG_CHECKING([for strerror_r() return])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <string.h>
], [
int r;
r = strerror_r(1, (char *) NULL, 0);
return 0;
])],[strerror_r_int=yes], [strerror_r_int=no])
if test "$strerror_r_int" = "yes"; then
AC_MSG_RESULT([int])
AC_DEFINE(STRERROR_R_T, [int], [strerror_r return type])
else
AC_MSG_RESULT([char *])
AC_DEFINE(STRERROR_R_T, [char *], [strerror_r return type])
fi
# How does accept() work on this system? # How does accept() work on this system?
AC_MSG_CHECKING([for accept() addrlen type]) AC_MSG_CHECKING([for accept() addrlen type])
OCFL="$CFLAGS" OCFL="$CFLAGS"

View File

@ -565,6 +565,9 @@ Pcap_Stream_Packetchain::~Pcap_Stream_Packetchain() {
} }
void Pcap_Stream_Packetchain::stop_stream(std::string in_reason) { void Pcap_Stream_Packetchain::stop_stream(std::string in_reason) {
// Force a lock here to ensure that the stream processor is done when we revoke it
local_locker l(&packet_mutex);
packetchain->RemoveHandler(packethandler_id, CHAINPOS_LOGGING); packetchain->RemoveHandler(packethandler_id, CHAINPOS_LOGGING);
Pcap_Stream_Ringbuf::stop_stream(in_reason); Pcap_Stream_Ringbuf::stop_stream(in_reason);
} }

View File

@ -915,25 +915,13 @@ std::string kis_strerror_r(int errnum) {
char *d_errstr = new char[1024]; char *d_errstr = new char[1024];
std::string rs; std::string rs;
// Deal with the XSI vs GNU versioning & compilers complaining about returns, osx handling, etc. STRERROR_R_T r;
// XSI and GNU define it differently and it's a huge pain.
#if defined(__APPLE__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
int r;
r = strerror_r(errnum, d_errstr, 1024); r = strerror_r(errnum, d_errstr, 1024);
rs = std::string(d_errstr); rs = std::string(d_errstr);
delete[] d_errstr; delete[] d_errstr;
return rs; return rs;
#else
char *r;
r = strerror_r(errnum, d_errstr, 1024);
rs = std::string(r);
delete[] d_errstr;
return rs;
#endif
} }
double ts_to_double(struct timeval ts) { double ts_to_double(struct timeval ts) {