From: Martin Schwenke Date: Tue, 28 Aug 2018 06:10:21 +0000 (+1000) Subject: ctdb-common: Check the version field in IPv6 packets X-Git-Tag: tdb-1.3.17~1959 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ceac9694f2f530e875ec56ec15867205ae088e;p=thirdparty%2Fsamba.git ctdb-common: Check the version field in IPv6 packets Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index 99c83c0ed5a..9336eb50713 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -818,6 +818,11 @@ static int tcp6_extract(const uint8_t *ip_pkt, /* IP6 */ ip6 = (const struct ip6_hdr *)ip_pkt; + /* IPv6 only */ + if ((ip6->ip6_vfc >> 4) != 6){ + return ENOMSG; + } + /* we only want TCP */ if (ip6->ip6_nxt != IPPROTO_TCP) { return ENOMSG;