Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style nits for using the longer, more explicit #if defined syntax; … #25

Merged
merged 1 commit into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions mod_proxy_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "conf.h"
#include "privs.h"

#ifdef HAVE_SYS_UIO_H
#if defined(HAVE_SYS_UIO_H)
# include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */

Expand Down Expand Up @@ -147,13 +147,13 @@ static int read_sock(int sockfd, void *buf, size_t reqlen) {
*/
if (xerrno == ECONNRESET ||
xerrno == ECONNABORTED ||
#ifdef ETIMEDOUT
#if defined(ETIMEDOUT)
xerrno == ETIMEDOUT ||
#endif /* ETIMEDOUT */
#ifdef ENOTCONN
#if defined(ENOTCONN)
xerrno == ENOTCONN ||
#endif /* ENOTCONN */
#ifdef ESHUTDOWN
#if defined(ESHUTDOWN)
xerrno == ESHUTDOWN ||
#endif /* ESHUTDOWNN */
xerrno == EPIPE) {
Expand Down Expand Up @@ -235,13 +235,13 @@ static int readv_sock(int sockfd, const struct iovec *iov, int count) {
*/
if (xerrno == ECONNRESET ||
xerrno == ECONNABORTED ||
#ifdef ETIMEDOUT
#if defined(ETIMEDOUT)
xerrno == ETIMEDOUT ||
#endif /* ETIMEDOUT */
#ifdef ENOTCONN
#if defined(ENOTCONN)
xerrno == ENOTCONN ||
#endif /* ENOTCONN */
#ifdef ESHUTDOWN
#if defined(ESHUTDOWN)
xerrno == ESHUTDOWN ||
#endif /* ESHUTDOWNN */
xerrno == EPIPE) {
Expand Down Expand Up @@ -438,7 +438,7 @@ static int read_haproxy_v1(pool *p, conn_t *conn,
if (strncmp(ptr, "TCP4 ", 5) == 0) {
have_tcp4 = TRUE;

#ifdef PR_USE_IPV6
#if defined(PR_USE_IPV6)
} else if (strncmp(ptr, "TCP6 ", 5) == 0) {
if (pr_netaddr_use_ipv6()) {
have_tcp6 = TRUE;
Expand Down Expand Up @@ -543,7 +543,7 @@ static int read_haproxy_v1(pool *p, conn_t *conn,
return -1;
}

#ifdef PR_USE_IPV6
#if defined(PR_USE_IPV6)
} else {
if (pr_netaddr_get_family(src_addr) != AF_INET6) {
pr_log_debug(DEBUG8, MOD_PROXY_PROTOCOL_VERSION
Expand Down Expand Up @@ -1063,7 +1063,7 @@ static int read_haproxy_v2(pool *p, conn_t *conn,
"of TLV data", (unsigned long) tlv_len);
}

#ifdef PR_USE_IPV6
#if defined(PR_USE_IPV6)
ipv6[0].iov_base = (void *) &src_ipv6;
ipv6[0].iov_len = sizeof(src_ipv6);
ipv6[1].iov_base = (void *) &dst_ipv6;
Expand Down Expand Up @@ -1530,7 +1530,7 @@ static int proxy_protocol_sess_init(void) {
server_rec *proxied_server = NULL;

/* Add "mod_proxy_protocol.proxied_server_addr" session note. With, or
* without, port?
* without, port?
*/

if (pr_netaddr_cmp(session.c->local_addr, proxied_dst_addr) != 0 ||
Expand Down