]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: netscaler: use the appropriate IPv6 header size
authorBertrand Jacquin <jacquinb@amazon.com>
Wed, 13 Dec 2017 01:40:24 +0000 (01:40 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Dec 2017 06:04:07 +0000 (07:04 +0100)
IPv6 header has a fixed size of 40 bytes, not 20.

src/connection.c

index a47d4d1fdb775802d8eca5314e4cd5ed00369216..c06babd926418644e30e9c7f018c6a9142fb97b6 100644 (file)
@@ -798,7 +798,7 @@ int conn_recv_netscaler_cip(struct connection *conn, int flag)
 
                hdr_ip6 = (struct ip6_hdr *)line;
 
-               if (trash.len < 28) {
+               if (trash.len < 48) {
                        /* Fail if buffer length is not large enough to contain
                         * CIP magic, CIP length, IPv6 header */
                        goto missing;
@@ -808,7 +808,7 @@ int conn_recv_netscaler_cip(struct connection *conn, int flag)
                        conn->err_code = CO_ER_CIP_BAD_PROTO;
                        goto fail;
                }
-               else if (trash.len < 48) {
+               else if (trash.len < 68) {
                        /* Fail if buffer length is not large enough to contain
                         * CIP magic, CIP length, IPv6 header, TCP header */
                        goto missing;