mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Define SOLARIS_BPF_PCAP_CAPTURE for Solaris 11.
Solaris 11 uses BPF packet capture rather than DLPI, which requires different handling in many cases. The new preprocessor symbol tells when this is the case; it is additional granularity on top of SOLARIS.
This commit is contained in:
parent
fd9260276c
commit
685f5fa4c3
8 changed files with 32 additions and 9 deletions
7
configure
vendored
7
configure
vendored
|
|
@ -4718,6 +4718,13 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
;;
|
||||
*-solaris2.1[1-9]*)
|
||||
$as_echo "#define SOLARIS 1" >>confdefs.h
|
||||
|
||||
# Solaris 11 and later use BPF packet capture rather than DLPI.
|
||||
$as_echo "#define SOLARIS_BPF_PCAP_CAPTURE 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
*-solaris2.0*)
|
||||
$as_echo "#define STUPID_SOLARIS_CHECKSUM_BUG 1" >>confdefs.h
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ case "$host" in
|
|||
AC_CHECK_LIB(cfg, _system_configuration)
|
||||
AC_CHECK_LIB(crypt, crypt_r)
|
||||
;;
|
||||
*-solaris2.1[[1-9]]*)
|
||||
AC_DEFINE(SOLARIS)
|
||||
# Solaris 11 and later use BPF packet capture rather than DLPI.
|
||||
AC_DEFINE(SOLARIS_BPF_PCAP_CAPTURE)
|
||||
;;
|
||||
*-solaris2.0*)
|
||||
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
|
||||
AC_DEFINE(SOLARIS)
|
||||
|
|
|
|||
|
|
@ -857,14 +857,10 @@ void set_ttl(int sd, int ttl) {
|
|||
#endif
|
||||
}
|
||||
|
||||
/* This should additionally be true for Solaris version 11 (but not 10 or
|
||||
earlier), but I haven't found a preprocessor symbol that allows easily
|
||||
testing that. Solaris 10 used DLPI for packet capture, but what OS X,
|
||||
FreeBSD, and Solaris 11 have in common is that they use BPF. We can get away
|
||||
with not having Solaris 11 here because the pcap_selectable_fd_one_to_one
|
||||
test is true for all Solaris and overrides this function everywhere it is
|
||||
used. */
|
||||
#if defined(WIN32) || defined(MACOSX) || (defined(FREEBSD) && (__FreeBSD_version < 500000))
|
||||
/* Other than WIN32, what these systems have in common is that they use BPF for
|
||||
packet capture. (Solaris 10 and earlier used DLPI and had valid selectable
|
||||
fds.) */
|
||||
#if defined(WIN32) || defined(MACOSX) || (defined(FREEBSD) && (__FreeBSD_version < 500000) || defined(SOLARIS_BPF_PCAP_CAPTURE))
|
||||
/* Returns whether the system supports pcap_get_selectable_fd() properly */
|
||||
int pcap_selectable_fd_valid() {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@
|
|||
#undef HAVE_OPENSSL
|
||||
|
||||
#undef STUPID_SOLARIS_CHECKSUM_BUG
|
||||
#undef SOLARIS_BPF_PCAP_CAPTURE
|
||||
|
||||
#undef SPRINTF_RETURNS_STRING
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@
|
|||
#undef NETBSD
|
||||
#undef MACOSX
|
||||
|
||||
#undef SOLARIS_BPF_PCAP_CAPTURE
|
||||
|
||||
#undef HAVE_NET_BPF_H
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
|
|
|
|||
7
nsock/src/configure
vendored
7
nsock/src/configure
vendored
|
|
@ -2216,6 +2216,13 @@ case "$host" in
|
|||
*-hpux*)
|
||||
$as_echo "#define HPUX 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
*-solaris2.1[1-9]*)
|
||||
$as_echo "#define SOLARIS 1" >>confdefs.h
|
||||
|
||||
# Solaris 11 and later use BPF packet capture rather than DLPI.
|
||||
$as_echo "#define SOLARIS_BPF_PCAP_CAPTURE 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
*-solaris2.0*)
|
||||
$as_echo "#define SOLARIS 1" >>confdefs.h
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ case "$host" in
|
|||
*-hpux*)
|
||||
AC_DEFINE(HPUX)
|
||||
;;
|
||||
*-solaris2.1[[1-9]]*)
|
||||
AC_DEFINE(SOLARIS)
|
||||
# Solaris 11 and later use BPF packet capture rather than DLPI.
|
||||
AC_DEFINE(SOLARIS_BPF_PCAP_CAPTURE)
|
||||
;;
|
||||
*-solaris2.0*)
|
||||
AC_DEFINE(SOLARIS)
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
*/
|
||||
|
||||
/* Returns whether the system supports pcap_get_selectable_fd() properly */
|
||||
#if !defined(WIN32) && !defined(SOLARIS)
|
||||
#if !defined(WIN32) && !defined(SOLARIS_BPF_PCAP_CAPTURE)
|
||||
#define PCAP_CAN_DO_SELECT 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue