MINOR: proxy: switch to conn->src in error snapshots

The source address was taken unchecked from a client connection. In
practice we know it's set but better strengthen this now.
This commit is contained in:
Willy Tarreau 2019-07-17 15:20:02 +02:00
parent 71e34c186a
commit 026efc71c8

View file

@ -1525,8 +1525,8 @@ void proxy_capture_error(struct proxy *proxy, int is_back,
es->when = date; // user-visible date
es->srv = objt_server(target);
es->oe = other_end;
if (objt_conn(sess->origin))
es->src = __objt_conn(sess->origin)->addr.from;
if (objt_conn(sess->origin) && conn_get_src(__objt_conn(sess->origin)))
es->src = *__objt_conn(sess->origin)->src;
else
memset(&es->src, 0, sizeof(es->src));