]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn_stream: remove the now unused CS_FL_ADDR_*_SET flags
authorWilly Tarreau <w@1wt.eu>
Mon, 2 May 2022 15:27:34 +0000 (17:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 May 2022 15:43:51 +0000 (17:43 +0200)
These flags indicate that the ->src or ->dst field in the conn_stream
is not null, which is something the caller already sees (and even tests
from the two sets of functions that set them). They maintain some burden
because an agent trying to set a source or destination has to manually
set the flags in addition to setting the pointer, so they provide no
value anymore, let's drop them.

dev/flags/flags.c
include/haproxy/conn_stream-t.h
include/haproxy/cs_utils.h

index 3a2b48ab9df2334e4b2b561e6190d17c1c0bb32d..2164a352b92046ee6953e65e947841fdcd3ef25c 100644 (file)
@@ -230,8 +230,6 @@ void show_cs_flags(unsigned int f)
        SHOW_FLAG(f, CS_FL_DONT_WAKE);
        SHOW_FLAG(f, CS_FL_NOLINGER);
        SHOW_FLAG(f, CS_FL_NOHALF);
-       SHOW_FLAG(f, CS_FL_ADDR_FROM_SET);
-       SHOW_FLAG(f, CS_FL_ADDR_TO_SET);
        SHOW_FLAG(f, CS_FL_ISBACK);
 
        if (f) {
index 9c5ccfb8f9dbb6b2afe3ce1f1c63a5fcb6e15b2f..ed25c28486ba0e109c9de19a6418767b707aa317 100644 (file)
@@ -86,8 +86,8 @@ enum {
        CS_FL_NONE          = 0x00000000,  /* Just for initialization purposes */
        CS_FL_ISBACK        = 0x00000001,  /* Set for CS on back-side */
 
-       CS_FL_ADDR_FROM_SET = 0x00000002, /* source address is set */
-       CS_FL_ADDR_TO_SET   = 0x00000004, /* destination address is set */
+       /* not used: 0x00000002 */
+       /* not used: 0x00000004 */
 
        CS_FL_NOLINGER      = 0x00000008,  /* may close without lingering. One-shot. */
        CS_FL_NOHALF        = 0x00000010,  /* no half close, close both sides at once */
index 684cb589c50fc37f153340a5abe6794a3fb4ac6e..9909984365fbe28ba901f287dc1e51e004e2da0c 100644 (file)
@@ -171,7 +171,7 @@ static inline int cs_alloc_ibuf(struct conn_stream *cs, struct buffer_wait *wait
  */
 static inline const struct sockaddr_storage *cs_src(struct conn_stream *cs)
 {
-       if (cs->flags & CS_FL_ADDR_FROM_SET)
+       if (cs->src)
                return cs->src;
        if (!(cs->flags & CS_FL_ISBACK))
                return sess_src(strm_sess(__cs_strm(cs)));
@@ -191,7 +191,7 @@ static inline const struct sockaddr_storage *cs_src(struct conn_stream *cs)
  */
 static inline const struct sockaddr_storage *cs_dst(struct conn_stream *cs)
 {
-       if (cs->flags & CS_FL_ADDR_TO_SET)
+       if (cs->dst)
                return cs->dst;
        if (!(cs->flags & CS_FL_ISBACK))
                return sess_dst(strm_sess(__cs_strm(cs)));
@@ -214,7 +214,7 @@ static inline int cs_get_src(struct conn_stream *cs)
 {
        const struct sockaddr_storage *src = NULL;
 
-       if (cs->flags & CS_FL_ADDR_FROM_SET)
+       if (cs->src)
                return 1;
 
        if (!(cs->flags & CS_FL_ISBACK))
@@ -231,7 +231,6 @@ static inline int cs_get_src(struct conn_stream *cs)
        if (!sockaddr_alloc(&cs->src, src, sizeof(*src)))
                return 0;
 
-       cs->flags |= CS_FL_ADDR_FROM_SET;
        return 1;
 }
 
@@ -245,7 +244,7 @@ static inline int cs_get_dst(struct conn_stream *cs)
 {
        const struct sockaddr_storage *dst = NULL;
 
-       if (cs->flags & CS_FL_ADDR_TO_SET)
+       if (cs->dst)
                return 1;
 
        if (!(cs->flags & CS_FL_ISBACK))
@@ -262,7 +261,6 @@ static inline int cs_get_dst(struct conn_stream *cs)
        if (!sockaddr_alloc(&cs->dst, dst, sizeof(*dst)))
                return 0;
 
-       cs->flags |= CS_FL_ADDR_TO_SET;
        return 1;
 }