diff --git a/include/proto/connection.h b/include/proto/connection.h index af9b77722..7ee54f2ca 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -468,6 +468,8 @@ static inline void conn_init(struct connection *conn) conn->send_wait = NULL; conn->recv_wait = NULL; conn->idle_time = 0; + conn->src = &conn->addr.from; + conn->dst = &conn->addr.to; } /* sets as the connection's owner */ diff --git a/include/types/connection.h b/include/types/connection.h index 6609f8b3d..816e06d0a 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -459,6 +459,8 @@ struct connection { /* third cache line and beyond */ void (*destroy_cb)(struct connection *conn); /* callback to notify of imminent death of the connection */ + struct sockaddr_storage *src; /* source address (pool), when known, otherwise NULL */ + struct sockaddr_storage *dst; /* destination address (pool), when known, otherwise NULL */ struct { struct sockaddr_storage from; /* client address, or address to spoof when connecting to the server */ struct sockaddr_storage to; /* address reached by the client, or address to connect to */