]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: Remove SI_FL_SRC_ADDR to rely on stream flags instead
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Mar 2022 14:26:39 +0000 (16:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:14 +0000 (15:10 +0200)
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.

dev/flags/flags.c
include/haproxy/stream-t.h
include/haproxy/stream_interface-t.h
include/haproxy/stream_interface.h
src/backend.c

index 318f3946ec0cbda92a168956b62622f1b4f195ba..367c55868b51fd6570bffe19f1e2600955578b2d 100644 (file)
@@ -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);
index faf68eee3cf3dee4d677b8f9a1a719b93a3a4d4c..e179e541735ee1f4309c50592eb291c983cc22da 100644 (file)
@@ -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 */
index 12a32bd661a7d12fb569a84df4a5fba038e6a600..fa1062e5a0163d0076596652200575293a048d34 100644 (file)
@@ -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 */
index 18892b271c8815db9be4ad98cdbffe81ca7006ad..0b02c9e338f130db285f0c5e9dab2a5b81e1035e 100644 (file)
@@ -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;
index 56e3c17801695544b7d7d75d6aec8f79212d87f8..259ff482d0c517e613fc93b55afa67566d397884 100644 (file)
@@ -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)