ngompa / rpms / pipewire

Forked from rpms/pipewire 3 years ago
Clone
Blob Blame History Raw
From 1cedfade3a9ac93f81dbb4230522d7494c7b7ea2 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Wed, 15 Jan 2020 12:24:11 +0100
Subject: [PATCH] protocol: improve old version check

Check if the pod size is > 4 because the unit test adds one fd
in the first message.
---
 src/modules/module-protocol-native/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c
index f99f33ed..b5de3063 100644
--- a/src/modules/module-protocol-native/connection.c
+++ b/src/modules/module-protocol-native/connection.c
@@ -313,7 +313,7 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
 
 	if (buf->first) {
 		buf->first = false;
-		if (p[3] != 0) {
+		if (p[3] >= 4) {
 			pw_log_warn("old version detected");
 			impl->version = 0;
 			impl->hdr_size = 8;
-- 
2.24.1