aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2017-03-31 17:40:13 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-04-03 17:22:29 +0300
commitc7014b4848c276c17dcdddab103ce88b3eb29235 (patch)
treef983cc3773ac761ef14982c3f69b3c875c95e14a /helper
parent503708078bf6ab9228d23ad65660b42248600c2d (diff)
helper: iplookuptable: fix prefix_entry_t member order
Depending on the alignment/padding odph_iplookup_table_put_value() could end up overwriting the wrong fields in prefix_entry_t. Fix this by reverting the order of prefix_entry_t members. Fixes https://bugs.linaro.org/show_bug.cgi?id=2910 Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r--helper/iplookuptable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c
index aae219945..37d31e368 100644
--- a/helper/iplookuptable.c
+++ b/helper/iplookuptable.c
@@ -42,6 +42,10 @@
*/
typedef struct {
union {
+ odp_buffer_t nexthop;
+ void *ptr;
+ };
+ union {
uint8_t u8;
struct {
#if ODP_BYTE_ORDER == ODP_BIG_ENDIAN
@@ -53,10 +57,6 @@ typedef struct {
#endif
};
};
- union {
- odp_buffer_t nexthop;
- void *ptr;
- };
} prefix_entry_t;
#define ENTRY_SIZE (sizeof(prefix_entry_t) + sizeof(odp_buffer_t))