]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: ns: HAProxy segfault if the cli_conn is not from a network connection
authorThierry FOURNIER <tfournier@exceliance.fr>
Fri, 19 Dec 2014 12:37:11 +0000 (13:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Dec 2014 22:39:29 +0000 (23:39 +0100)
The path "MAJOR: namespace: add Linux network namespace support" doesn't
permit to use internal data producer like a "peers synchronisation"
system. The result is a segfault when the internal application starts.

This patch fix the commit b3e54fe387c7c1ea750f39d3029672d640c499f9
It is introduced in 1.6dev version, it doesn't need to be backported.

src/backend.c

index 70ddaa7d1037c0f83fafc1f46fd5686a3bfe09eb..32e19f91569435dd1ae7b3fa7d319170f3ecacc7 100644 (file)
@@ -804,7 +804,7 @@ int assign_server_address(struct session *s)
        }
 
        /* Copy network namespace from client connection */
-       srv_conn->proxy_netns = cli_conn->proxy_netns;
+       srv_conn->proxy_netns = cli_conn ? cli_conn->proxy_netns : NULL;
 
        s->flags |= SN_ADDR_SET;
        return SRV_STATUS_OK;