summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/no-unaligned-access.patch27
-rw-r--r--debian/patches/series1
2 files changed, 28 insertions, 0 deletions
diff --git a/debian/patches/no-unaligned-access.patch b/debian/patches/no-unaligned-access.patch
new file mode 100644
index 0000000..9bec4c3
--- /dev/null
+++ b/debian/patches/no-unaligned-access.patch
@@ -0,0 +1,27 @@
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Description: Fix unaligned access in buffer copies
+ There's a TODO in the source about fixing alignment of the address being
+ copied. This unaligned access is a problem on armhf with some kernel
+ configurations, and is generally slower even on other architectures due
+ to the fixups. Just use memcpy instead which is bound to do the right
+ thing.
+
+Index: nfstrace-0.4.2/src/filtration/sessions_hash.h
+===================================================================
+--- nfstrace-0.4.2.orig/src/filtration/sessions_hash.h
++++ nfstrace-0.4.2/src/filtration/sessions_hash.h
+@@ -105,12 +105,8 @@
+
+ static inline void copy_ipv6(uint32_t dst[4], const uint8_t src[16])
+ {
+- // TODO:: fix alignment of src!
+- const uint32_t* s { reinterpret_cast<const uint32_t*>(src) };
+- dst[0] = s[0];
+- dst[1] = s[1];
+- dst[2] = s[2];
+- dst[3] = s[3];
++ uint8_t* d { reinterpret_cast<uint8_t*>(dst) };
++ memcpy(d, src, sizeof(uint32_t) * 4);
+ }
+
+ struct IPv6PortsKeyHash
diff --git a/debian/patches/series b/debian/patches/series
index 466da0d..30db1ba 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
reproducible_build.patch
gcc6-ftbfs.patch
+no-unaligned-access.patch