MINOR: remove the client/server side distinction in SI addresses
Stream interfaces used to distinguish between client and server addresses
because they were previously of different types (sockaddr_storage for the
client, sockaddr_in for the server). This is not the case anymore, and this
distinction is confusing at best and has caused a number of regressions to
be introduced in the process of converting everything to full-ipv6. We can
now remove this and have a much cleaner code.
diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h
index ae23c72..1665f15 100644
--- a/include/proto/proto_tcp.h
+++ b/include/proto/proto_tcp.h
@@ -43,12 +43,12 @@
*/
static inline struct stktable_key *tcp_src_to_stktable_key(struct session *s)
{
- switch (s->si[0].addr.c.from.ss_family) {
+ switch (s->si[0].addr.from.ss_family) {
case AF_INET:
- static_table_key.key = (void *)&((struct sockaddr_in *)&s->si[0].addr.c.from)->sin_addr;
+ static_table_key.key = (void *)&((struct sockaddr_in *)&s->si[0].addr.from)->sin_addr;
break;
case AF_INET6:
- static_table_key.key = (void *)&((struct sockaddr_in6 *)&s->si[0].addr.c.from)->sin6_addr;
+ static_table_key.key = (void *)&((struct sockaddr_in6 *)&s->si[0].addr.from)->sin6_addr;
break;
}
return &static_table_key;
diff --git a/include/types/stream_interface.h b/include/types/stream_interface.h
index 27a2f97..4f0bfa2 100644
--- a/include/types/stream_interface.h
+++ b/include/types/stream_interface.h
@@ -178,16 +178,10 @@
} cli;
} ctx; /* used by stats I/O handlers to dump the stats */
} applet;
- union {
- struct {
- struct sockaddr_storage from; /* the client address */
- struct sockaddr_storage to; /* the address reached by the client if SN_FRT_ADDR_SET is set */
- } c; /* client side */
- struct {
- struct sockaddr_storage from; /* the address to spoof when connecting to the server (transparent mode) */
- struct sockaddr_storage to; /* the address to connect to */
- } s; /* server side */
- } addr; /* addresses of the remote side */
+ 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 if SN_FRT_ADDR_SET is set, or address to connect to */
+ } addr; /* addresses of the remote side, client for producer and server for consumer */
};
/* An applet designed to run in a stream interface */