From 664dff4644f2409d047a302ace38551deb2724a8 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 3 Apr 2012 23:06:07 +0000 Subject: [PATCH] Add a long comment about Solaris 11 BPF. I was surprised when I found that Solaris 11 scanning works now. I thought that it would require a change in the defines around pcap_selectable_fd_valid, because it's valid for Solaris 10 and earlier but not for Solaris 11. Why it started working was the pcap_selectable_fd_one_to_one test added in r28319. As a side effect of that function overrides pcap_selectable_fd_valid for all Solaris releases, it makes changes in pcap_selectable_fd_valid unnecessary. However it is indirect in the way it does it, so I'm adding a comment explaining the situation and a hope that there is an easy change to make pcap_selectable_fd_valid correct on its own. --- libnetutil/netutil.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 978b47e74..126925281 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -857,6 +857,13 @@ 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)) /* Returns whether the system supports pcap_get_selectable_fd() properly */ int pcap_selectable_fd_valid() {