From 44b6eadedbef4c189818adf090a484f0f0daec0f Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 9 Jan 2024 13:39:09 -0600 Subject: [PATCH] add upstream patch for eninanness bug https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/commit/6662764338d3127924cfefaa9cf1b0cc4f90a189 Signed-off-by: Dennis Gilmore --- ...764338d3127924cfefaa9cf1b0cc4f90a189.patch | 34 +++++++++++++++++++ libqmi.spec | 6 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 6662764338d3127924cfefaa9cf1b0cc4f90a189.patch diff --git a/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch b/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch new file mode 100644 index 0000000..4f25105 --- /dev/null +++ b/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch @@ -0,0 +1,34 @@ +From 6662764338d3127924cfefaa9cf1b0cc4f90a189 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Sat, 21 Oct 2023 11:43:09 +0200 +Subject: [PATCH] libqmi-glib,message: fix 16-bit service on big endian + architectures + +The latest release introduces handling of 16-bit service indications. +However, only the raw message data is returned from +`qmi_message_get_service()`, leading to incorrect values on big-endian +architectures. As a consequence, `libqmi` ultimately fails to build as +the corresponding test errors out in this case. + +This patch ensures the service indication is correct on all kinds of +architectures. +--- + src/libqmi-glib/qmi-message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c +index 3e31b4b4..1918a456 100644 +--- a/src/libqmi-glib/qmi-message.c ++++ b/src/libqmi-glib/qmi-message.c +@@ -226,7 +226,7 @@ qmi_message_get_service (QmiMessage *self) + if (MESSAGE_IS_QMUX (self)) + return (QmiService)((struct full_message *)(self->data))->header.qmux.service; + +- return (QmiService)((struct full_message *)(self->data))->header.qrtr.service; ++ return (QmiService)GUINT16_FROM_LE (((struct full_message *)(self->data))->header.qrtr.service); + } + + guint8 +-- +GitLab + diff --git a/libqmi.spec b/libqmi.spec index 14b693f..2140201 100644 --- a/libqmi.spec +++ b/libqmi.spec @@ -6,6 +6,10 @@ License: LGPL-2.1-or-later URL: http://freedesktop.org/software/libqmi Source: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/archive/%{version}/%{name}-%{version}.tar.bz2 +# upstream patch for big endian issue +# https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/commit/6662764338d3127924cfefaa9cf1b0cc4f90a189 +Patch0: 6662764338d3127924cfefaa9cf1b0cc4f90a189.patch + BuildRequires: meson >= 0.53 BuildRequires: gcc BuildRequires: glib2-devel >= 2.56 @@ -95,7 +99,7 @@ cp -a src/qmicli/qmicli %{buildroot}%{_datadir}/bash-completion/completions/ %changelog -* Mon Jan 09 2024 Dennis Gilmore - 1.34.0-1 +* Tue Jan 09 2024 Dennis Gilmore - 1.34.0-1 - update to 1.34.0 * Thu Nov 2 2023 Íñigo Huguet - 1.32.4-3