diff --git a/dev/flags/flags.c b/dev/flags/flags.c index 318f3946e..367c55868 100644 --- a/dev/flags/flags.c +++ b/dev/flags/flags.c @@ -269,7 +269,6 @@ void show_si_flags(unsigned int f) SHOW_FLAG(f, SI_FL_WAIT_DATA); SHOW_FLAG(f, SI_FL_ISBACK); - SHOW_FLAG(f, SI_FL_SRC_ADDR); SHOW_FLAG(f, SI_FL_WANT_GET); SHOW_FLAG(f, SI_FL_CLEAN_ABRT); SHOW_FLAG(f, SI_FL_RXBLK_CHAN); @@ -380,6 +379,7 @@ void show_strm_flags(unsigned int f) return; } + SHOW_FLAG(f, SF_SRC_ADDR); SHOW_FLAG(f, SF_WEBSOCKET); SHOW_FLAG(f, SF_SRV_REUSED_ANTICIPATED); SHOW_FLAG(f, SF_SRV_REUSED); diff --git a/include/haproxy/stream-t.h b/include/haproxy/stream-t.h index faf68eee3..e179e5417 100644 --- a/include/haproxy/stream-t.h +++ b/include/haproxy/stream-t.h @@ -82,6 +82,7 @@ #define SF_SRV_REUSED 0x00100000 /* the server-side connection was reused */ #define SF_SRV_REUSED_ANTICIPATED 0x00200000 /* the connection was reused but the mux is not ready yet */ #define SF_WEBSOCKET 0x00400000 /* websocket stream */ // TODO: must be removed +#define SF_SRC_ADDR 0x00800000 /* get the source ip/port with getsockname */ /* flags for the proxy of the master CLI */ /* 0x0001.. to 0x8000 are reserved for ACCESS_* flags from cli-t.h */ diff --git a/include/haproxy/stream_interface-t.h b/include/haproxy/stream_interface-t.h index 12a32bd66..fa1062e5a 100644 --- a/include/haproxy/stream_interface-t.h +++ b/include/haproxy/stream_interface-t.h @@ -86,7 +86,6 @@ enum { /* unused: 0x00000001, 0x00000002 */ SI_FL_WAIT_DATA = 0x00000008, /* stream-int waits for more outgoing data to send */ SI_FL_ISBACK = 0x00000010, /* 0 for front-side SI, 1 for back-side */ - SI_FL_SRC_ADDR = 0x00001000, /* get the source ip/port with getsockname */ /* unused: 0x00000200 */ SI_FL_WANT_GET = 0x00004000, /* a stream-int would like to get some data from the buffer */ SI_FL_CLEAN_ABRT = 0x00008000, /* SI_FL_ERR is used to report aborts, and not SHUTR */ diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h index 18892b271..0b02c9e33 100644 --- a/include/haproxy/stream_interface.h +++ b/include/haproxy/stream_interface.h @@ -387,7 +387,7 @@ static inline int si_connect(struct stream_interface *si, struct connection *con } /* needs src ip/port for logging */ - if (si->flags & SI_FL_SRC_ADDR) + if (si_strm(si)->flags & SF_SRC_ADDR) conn_get_src(conn); return ret; diff --git a/src/backend.c b/src/backend.c index 56e3c1780..259ff482d 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1637,7 +1637,7 @@ skip_reuse: /* flag for logging source ip/port */ if (strm_fe(s)->options2 & PR_O2_SRC_ADDR) - cs_si(s->csb)->flags |= SI_FL_SRC_ADDR; + s->flags |= SF_SRC_ADDR; /* disable lingering */ if (s->be->options & PR_O_TCP_NOLING)