mirror of
https://github.com/nmap/nmap.git
synced 2025-12-19 05:59:01 +00:00
[NSOCK] Sandwitched pcap_read_on_nonselect() statements between #ifndef
PCAP_CAN_DO_SELECT guards to prevent them from being executed on systems that actually provide selectable pcap descriptors.
This commit is contained in:
@@ -109,8 +109,10 @@ static void iterate_through_event_lists(mspool *nsp, int evcount);
|
||||
void process_iod_events(mspool *nsp, msiod *nsi, int ev);
|
||||
void process_event(mspool *nsp, gh_list *evlist, msevent *nse, int ev);
|
||||
#if HAVE_PCAP
|
||||
#ifndef PCAP_CAN_DO_SELECT
|
||||
int pcap_read_on_nonselect(mspool *nsp);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* defined in nsock_event.c */
|
||||
void update_first_events(msevent *nse);
|
||||
@@ -280,11 +282,13 @@ int epoll_loop(mspool *nsp, int msec_timeout) {
|
||||
combined_msecs = MIN((unsigned)event_msecs, (unsigned)msec_timeout);
|
||||
|
||||
#if HAVE_PCAP
|
||||
#ifndef PCAP_CAN_DO_SELECT
|
||||
/* do non-blocking read on pcap devices that doesn't support select()
|
||||
* If there is anything read, just leave this loop. */
|
||||
if (pcap_read_on_nonselect(nsp)) {
|
||||
/* okay, something was read. */
|
||||
} else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
if (einfo->evlen)
|
||||
|
||||
@@ -126,8 +126,10 @@ void process_event(mspool *nsp, gh_list *evlist, msevent *nse, int ev);
|
||||
void process_iod_events(mspool *nsp, msiod *nsi, int ev);
|
||||
|
||||
#if HAVE_PCAP
|
||||
#ifndef PCAP_CAN_DO_SELECT
|
||||
int pcap_read_on_nonselect(mspool *nsp);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* defined in nsock_event.c */
|
||||
void update_first_events(msevent *nse);
|
||||
@@ -315,11 +317,13 @@ int select_loop(mspool *nsp, int msec_timeout) {
|
||||
}
|
||||
|
||||
#if HAVE_PCAP
|
||||
#ifndef PCAP_CAN_DO_SELECT
|
||||
/* do non-blocking read on pcap devices that doesn't support select()
|
||||
* If there is anything read, just leave this loop. */
|
||||
if (pcap_read_on_nonselect(nsp)) {
|
||||
/* okay, something was read. */
|
||||
} else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
/* Set up the descriptors for select */
|
||||
|
||||
Reference in New Issue
Block a user