]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: stktable: tcp_src_to_stktable_key() must return NULL on invalid families
authorWilly Tarreau <w@1wt.eu>
Thu, 30 Aug 2012 20:52:28 +0000 (22:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 31 Aug 2012 09:03:30 +0000 (11:03 +0200)
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.

include/proto/proto_tcp.h

index 374c7fdb20b83aa93605c54ac71b3c6e66e6deb4..c61fd86c97b3d17b6fe59e6bb85c6e07b6b35b12 100644 (file)
@@ -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;
 }