]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: frontend: switch from conn->addr.{from,to} to conn->{src,dst}
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jul 2019 15:11:40 +0000 (17:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Jul 2019 11:50:09 +0000 (13:50 +0200)
All these values were already checked, it's safe to use them as-is.

src/frontend.c

index 92c8323ee4308fa907bd046169bafd5b2b337353..23b9c3c31cf7a55be56123aebf68777859913ac4 100644 (file)
@@ -73,18 +73,18 @@ int frontend_accept(struct stream *s)
                        char pn[INET6_ADDRSTRLEN], sn[INET6_ADDRSTRLEN];
                        int port;
 
-                       switch (addr_to_str(&conn->addr.from, pn, sizeof(pn))) {
+                       switch (addr_to_str(conn->src, pn, sizeof(pn))) {
                        case AF_INET:
                        case AF_INET6:
                                if (conn_get_dst(conn)) {
-                                       addr_to_str(&conn->addr.to, sn, sizeof(sn));
-                                       port = get_host_port(&conn->addr.to);
+                                       addr_to_str(conn->dst, sn, sizeof(sn));
+                                       port = get_host_port(conn->dst);
                                } else {
                                        strcpy(sn, "undetermined address");
                                        port = 0;
                                }
                                send_log(fe, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n",
-                                        pn, get_host_port(&conn->addr.from),
+                                        pn, get_host_port(conn->src),
                                         sn, port,
                                         fe->id, (fe->mode == PR_MODE_HTTP) ? "HTTP" : "TCP");
                                break;
@@ -119,12 +119,12 @@ int frontend_accept(struct stream *s)
                                     s->uniq_id, fe->id, (unsigned short)l->fd, (unsigned short)conn->handle.fd,
                                     l->luid, alpn);
                }
-               else switch (addr_to_str(&conn->addr.from, pn, sizeof(pn))) {
+               else switch (addr_to_str(conn->src, pn, sizeof(pn))) {
                case AF_INET:
                case AF_INET6:
                        chunk_printf(&trash, "%08x:%s.accept(%04x)=%04x from [%s:%d] ALPN=%s\n",
                                     s->uniq_id, fe->id, (unsigned short)l->fd, (unsigned short)conn->handle.fd,
-                                    pn, get_host_port(&conn->addr.from), alpn);
+                                    pn, get_host_port(conn->src), alpn);
                        break;
                case AF_UNIX:
                        /* UNIX socket, only the destination is known */