From: Christopher Faulet Date: Wed, 30 Mar 2022 14:26:39 +0000 (+0200) Subject: MINOR: stream-int: Remove SI_FL_SRC_ADDR to rely on stream flags instead X-Git-Tag: v2.6-dev6~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d139138bbc12bdf6bfd182ea5afb0cfee01c0e9e;p=thirdparty%2Fhaproxy.git MINOR: stream-int: Remove SI_FL_SRC_ADDR to rely on stream flags instead Flag to get the source ip/port with getsockname is now handled at the stream level. Thus SI_FL_SRC_ADDR stream-int flag is replaced by SF_SRC_ADDR stream flag. --- diff --git a/dev/flags/flags.c b/dev/flags/flags.c index 318f3946ec..367c55868b 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 faf68eee3c..e179e54173 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 12a32bd661..fa1062e5a0 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 18892b271c..0b02c9e338 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 56e3c17801..259ff482d0 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)