Bug 1228 - OpenSSL include is not guarded with HAVE_SSL
OpenSSL include is not guarded with HAVE_SSL
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: NSD Code
4.1.x
x86_64 Linux
: P5 normal
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-05 21:01 CET by Eric Pruitt
Modified: 2017-03-06 09:08 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Pruitt 2017-03-05 21:01:53 CET
After configuring NSD "--with-ssl=no", the build fails to complete because there is an OpenSSL include inside of server.c that is not protected by an include guard on line 40:

    37  #ifdef HAVE_MMAP
    38  #include <sys/mman.h>
    39  #endif /* HAVE_MMAP */
    40  #include <openssl/rand.h>
    41  #ifndef USE_MINI_EVENT
    42  #  ifdef HAVE_EVENT_H
    43  #    include <event.h>

To fix this, I added a preprocessor condition using HAVE_SSL:

    37  #ifdef HAVE_MMAP
    38  #include <sys/mman.h>
    39  #endif /* HAVE_MMAP */
    40  #ifdef HAVE_SSL
    41  #include <openssl/rand.h>
    42  #endif
    43  #ifndef USE_MINI_EVENT
    44  #  ifdef HAVE_EVENT_H
    45  #    include <event.h>
Comment 1 Wouter Wijngaards 2017-03-06 09:08:43 CET
Hi Eric,

Thank you for the report.  This fix is included now, and I resolved a compiler warning for --with-ssl=no.

Best regards, Wouter