[libosmo-sccp] 02/02: Patch big-endian problematic struct

Ruben Undheim rubund-guest at moszumanska.debian.org
Thu Feb 11 21:03:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to branch master
in repository libosmo-sccp.

commit 82773d89c8c0fc9995153baf3be404d329aa51dc
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Feb 11 21:20:19 2016 +0100

    Patch big-endian problematic struct
---
 debian/patches/03_fix_for_big_endian.patch | 57 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 58 insertions(+)

diff --git a/debian/patches/03_fix_for_big_endian.patch b/debian/patches/03_fix_for_big_endian.patch
new file mode 100644
index 0000000..ca6f216
--- /dev/null
+++ b/debian/patches/03_fix_for_big_endian.patch
@@ -0,0 +1,57 @@
+Description: <short summary of the patch>
+ TODO: Put a short summary on the line above and replace this paragraph
+ with a longer explanation of this change. Complete the meta-information
+ with other relevant fields (see below for details). To make it easier, the
+ information below has been extracted from the changelog. Adjust it or drop
+ it.
+ .
+ libosmo-sccp (0.7.0-1) unstable; urgency=low
+ .
+   * Initial release (Closes: #813294)
+Author: Ruben Undheim <ruben.undheim at gmail.com>
+Bug-Debian: https://bugs.debian.org/813294
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+Index: libosmo-sccp/src/sccp.c
+===================================================================
+--- libosmo-sccp.orig/src/sccp.c	2016-02-05 16:56:35.845659264 +0100
++++ libosmo-sccp/src/sccp.c	2016-02-11 21:48:58.066093403 +0100
+@@ -1392,14 +1392,26 @@
+ uint32_t sccp_src_ref_to_int(struct sccp_source_reference *ref)
+ {
+ 	uint32_t src_ref = 0;
++#if OSMO_IS_LITTLE_ENDIAN
+ 	memcpy(&src_ref, ref, sizeof(*ref));
++#elif OSMO_IS_BIG_ENDIAN
++	memcpy((((char*)(&src_ref))+3),&(ref->octet1),1);
++	memcpy((((char*)(&src_ref))+2),&(ref->octet2),1);
++	memcpy((((char*)(&src_ref))+1),&(ref->octet3),1);
++#endif
+ 	return src_ref;
+ }
+ 
+ struct sccp_source_reference sccp_src_ref_from_int(uint32_t int_ref)
+ {
+ 	struct sccp_source_reference ref;
++#if OSMO_IS_LITTLE_ENDIAN
+ 	memcpy(&ref, &int_ref, sizeof(ref));
++#elif OSMO_IS_BIG_ENDIAN
++	memcpy(&(ref.octet1),(((char*)(&int_ref))+3),1);
++	memcpy(&(ref.octet2),(((char*)(&int_ref))+2),1);
++	memcpy(&(ref.octet3),(((char*)(&int_ref))+1),1);
++#endif
+ 	return ref;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index bfe57aa..53939ca 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01_make_library_shared.patch
 02_set_version_explicitly.patch
+03_fix_for_big_endian.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libosmo-sccp.git



More information about the debian-science-commits mailing list