diff --git a/include/haproxy/server.h b/include/haproxy/server.h index cf5c5584c..39f71e05e 100644 --- a/include/haproxy/server.h +++ b/include/haproxy/server.h @@ -383,12 +383,8 @@ static inline struct server *server_find_by_id(struct proxy *bk, int id) static inline int srv_is_quic(const struct server *srv) { -#ifdef USE_QUIC return srv->addr_type.proto_type == PROTO_TYPE_DGRAM && srv->addr_type.xprt_type == PROTO_TYPE_STREAM; -#else - return 0; -#endif } #endif /* _HAPROXY_SERVER_H */ diff --git a/src/server.c b/src/server.c index 26103cf18..02980db72 100644 --- a/src/server.c +++ b/src/server.c @@ -3928,8 +3928,8 @@ static int _srv_parse_finalize(char **args, int cur_arg, } } -#ifdef USE_QUIC if (srv_is_quic(srv)) { +#ifdef USE_QUIC if (!srv->use_ssl) { srv->use_ssl = 1; ha_warning("QUIC protocol detected, enabling ssl. Use 'ssl' to shut this warning.\n"); @@ -3940,8 +3940,11 @@ static int _srv_parse_finalize(char **args, int cur_arg, &srv->ssl_ctx.alpn_len, &errmsg) != 0) { return ERR_ALERT | ERR_FATAL; } - } +#else + ha_alert("QUIC protocol selected but support not compiled in (check build options).\n"); + return ERR_ALERT | ERR_FATAL; #endif + } if (!(srv->proxy->cap & PR_CAP_LB)) { /* No need to wait for effective proxy mode, it is already known: