From 2b6a3a73edfc2ffbca5f3ff21eb5fc87c4518299 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Mon, 29 Apr 2013 10:51:04 -0400 Subject: [PATCH] [Listener] Fix compilation with confuse (-r/-R) The handling of -r/-R was buggy with libconfuse enabled. --- owlps-listener/owlps-listener.h | 2 +- owlps-listener/owlps-listenerd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/owlps-listener/owlps-listener.h b/owlps-listener/owlps-listener.h index ebc245e..96c2c72 100644 --- a/owlps-listener/owlps-listener.h +++ b/owlps-listener/owlps-listener.h @@ -480,7 +480,7 @@ void print_version(void) ; * false if we are reading from a pcap file. */ #define LIVE_CAPTURING \ - (! GET_PCAP_FILE()) + (GET_RTAP_IFACE()[0] != '\0') #endif // _OWLPS_LISTENER_H_ diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 35148f8..ee69e92 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -660,7 +660,7 @@ int check_configuration() } // Packet source // - if (GET_PCAP_FILE()) + if (GET_PCAP_FILE() && GET_PCAP_FILE()[0] != '\0') { if (GET_RTAP_IFACE()[0] != '\0') { @@ -931,7 +931,7 @@ int capture() if (capture_handler == NULL) // Capture starting failed { - fprintf(stderr, "Cannot create capture handler on '%s'%s\n", + fprintf(stderr, "Cannot create capture handler on '%s': %s\n", source, errbuf) ; // Note: errbuf starts with ": " return OWL_ERR_IFACE_PCAP_OPEN ; }