tcp: Disable optimisations for tcp_hash()
I'm not sure if we're breaking some aliasing rule here, but with gcc 12.2.1 on x86_64 and -flto, the siphash_20b() call in tcp_hash() doesn't see the connection address -- it gets all zeroes instead. Fix this temporarily by disabling optimisations for this tcp_hash(). Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
933aa1014b
commit
4ddbcb9c0c
1 changed files with 3 additions and 0 deletions
3
tcp.c
3
tcp.c
|
@ -1185,6 +1185,9 @@ static int tcp_hash_match(const struct tcp_tap_conn *conn,
|
||||||
#if TCP_HASH_NOINLINE
|
#if TCP_HASH_NOINLINE
|
||||||
__attribute__((__noinline__)) /* See comment in Makefile */
|
__attribute__((__noinline__)) /* See comment in Makefile */
|
||||||
#endif
|
#endif
|
||||||
|
__attribute__((optimize("O0"))) /* TODO: with -O2 and -flto on gcc 12.2,
|
||||||
|
* siphash_20b() doesn't see 'addr', why?
|
||||||
|
*/
|
||||||
static unsigned int tcp_hash(const struct ctx *c, const union inany_addr *addr,
|
static unsigned int tcp_hash(const struct ctx *c, const union inany_addr *addr,
|
||||||
in_port_t tap_port, in_port_t sock_port)
|
in_port_t tap_port, in_port_t sock_port)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue