Merged, thanks!
Maxim.
On 01/11/2015 01:15 PM, Shmulik Ladkani wrote:
ODP_{BIG,LITTLE}_ENDIAN_BITFIELD were always defined, regardless the
value of system's __BIG_ENDIAN_BITFIELD and __LITTLE_ENDIAN_BITFIELD.
As a result, 'odph_tcphdr_t' bitfields in odph_tcp.h were always
arranged as big-endian.
This lead to incorrect parsing in linux-generic's 'parse_tcp' for
little endian systems, which resulted in packet's 'tcp_err' being set.
Fixed by defining ODP_BIG_ENDIAN_BITFIELD or ODP_LITTLE_ENDIAN_BITFIELD
conditionally per system's bitfield endianess.
Signed-off-by: Shmulik Ladkani <[email protected]>
---
platform/linux-generic/include/api/odp_byteorder.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/platform/linux-generic/include/api/odp_byteorder.h
b/platform/linux-generic/include/api/odp_byteorder.h
index 5d7cceb4a8..5890011028 100644
--- a/platform/linux-generic/include/api/odp_byteorder.h
+++ b/platform/linux-generic/include/api/odp_byteorder.h
@@ -47,10 +47,14 @@ extern "C" {
#define ODP_LITTLE_ENDIAN __LITTLE_ENDIAN
/** Big endian bit field */
-#define ODP_BIG_ENDIAN_BITFIELD __BIG_ENDIAN_BITFIELD
+#ifdef __BIG_ENDIAN_BITFIELD
+#define ODP_BIG_ENDIAN_BITFIELD
+#endif
/** Little endian bit field */
-#define ODP_LITTLE_ENDIAN_BITFIELD __LITTLE_ENDIAN_BITFIELD
+#ifdef __LITTLE_ENDIAN_BITFIELD
+#define ODP_LITTLE_ENDIAN_BITFIELD
+#endif
/** Selected byte order */
#if __BYTE_ORDER == __LITTLE_ENDIAN
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp