From: Willy Tarreau Date: Thu, 30 Aug 2012 20:52:28 +0000 (+0200) Subject: BUG: stktable: tcp_src_to_stktable_key() must return NULL on invalid families X-Git-Tag: v1.5-dev12~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c3a08a136b9efd086a110f454f8261c0dd79cf6b;p=thirdparty%2Fhaproxy.git BUG: stktable: tcp_src_to_stktable_key() must return NULL on invalid families Source addresses of non-TCP families were not correctly handled by tcp_src_to_stktable_key() as it forgot to return NULL and instead left the previous value in the stick-table buffer. This bug is 1.5-specific and was introduced by commit 4f92d320 in 1.5-dev6 so it does not need any backport. --- diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h index 374c7fdb20..c61fd86c97 100644 --- a/include/proto/proto_tcp.h +++ b/include/proto/proto_tcp.h @@ -52,6 +52,8 @@ static inline struct stktable_key *tcp_src_to_stktable_key(struct session *s) case AF_INET6: static_table_key.key = (void *)&((struct sockaddr_in6 *)&s->si[0].addr.from)->sin6_addr; break; + default: + return NULL; } return &static_table_key; }