aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/net_misc.h
diff options
context:
space:
mode:
authorMariusz Drost <mariuszx.drost@intel.com>2019-10-09 10:16:20 +0100
committerMariusz Drost <mariuszx.drost@intel.com>2019-10-09 10:32:09 +0100
commit0e37b2e9d04bbc8e91833e45ce3e4535255a796e (patch)
tree965cf35af344129cf46f613335c3784d5a5ca7ad /lib/libtle_l4p/net_misc.h
parente4380f4866091fd92a7a57667dd938a99144f9cd (diff)
l4p/tcp: fix SIGSEGV when reading IPv6 address
IPv6 address is obtained through pointer to mbuf (part storing IPv6 addr). Structure which then holds that pointer defines it as a pointer to _m128i data type. Because of that, when code is optimized, instruction vmovdqa is used, which requires data to be aligned to 16-bytes. Pointer from mbuf does not have to be aligned in that way, which may cause SIGSEGV. Solution is to add attribute packed and aligned(1) to structure holding IPv6 address. With that, vmovdqu assembly instruction is used, which is the equivalent of vmovdqa, but for unaligned data. Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com> Change-Id: I66e7ce2a317de2cdbc763ec8e31141605b5e5469
Diffstat (limited to 'lib/libtle_l4p/net_misc.h')
-rw-r--r--lib/libtle_l4p/net_misc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libtle_l4p/net_misc.h b/lib/libtle_l4p/net_misc.h
index 2d8dac2..d5896de 100644
--- a/lib/libtle_l4p/net_misc.h
+++ b/lib/libtle_l4p/net_misc.h
@@ -64,7 +64,7 @@ union ipv6_addrs {
rte_xmm_t src;
rte_xmm_t dst;
};
-};
+} __attribute__((packed, aligned(1)));
union ip_addrs {
union ipv4_addrs v4;