Skip to content

Commit

Permalink
BUILD: quic: Missing quic_ssl.h header protection
Browse files Browse the repository at this point in the history
Such "#ifdef USE_QUIC" prepocessor statements are used by QUIC C header
to avoid inclusion of QUIC headers when the QUIC support is not enabled
(by USE_QUIC make variable). Furthermore, this allows inclusions of QUIC
header from C file without having to protect them with others "#ifdef USE_QUIC"
statements as follows:

   #ifdef USE_QUIC
   #include <a QUIC header>
   #include <another one QUIC header>
   #endif /* USE_QUIC */

So, here if this quic_ssl.h header was included by a C file, and compiled without
QUIC support, this will lead to build errrors as follows:

 In file included from <a C file...>:
        include/haproxy/quic_ssl.h:35:35: warning: ‘enum ssl_encryption_level_t’
        declared inside parameter list will not be visible outside of this
        definition or declaration

Should be backported to 2.9 to avoid such building issues to come.

(cherry picked from commit fd178cc)
Signed-off-by: Willy Tarreau <[email protected]>
  • Loading branch information
haproxyFred authored and wtarreau committed Jan 5, 2024
1 parent d73c2d1 commit 8ff3edf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/haproxy/quic_ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#ifndef _HAPROXY_QUIC_SSL_H
#define _HAPROXY_QUIC_SSL_H

#ifdef USE_QUIC
#ifndef USE_OPENSSL
#error "Must define USE_OPENSSL"
#endif

#include <haproxy/listener-t.h>
#include <haproxy/ncbuf-t.h>
#include <haproxy/openssl-compat.h>
Expand All @@ -46,4 +51,5 @@ static inline void qc_free_ssl_sock_ctx(struct ssl_sock_ctx **ctx)
*ctx = NULL;
}

#endif /* USE_QUIC */
#endif /* _HAPROXY_QUIC_SSL_H */

0 comments on commit 8ff3edf

Please sign in to comment.