lkml.org 
[lkml]   [2018]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tipc: fix issue that tipc_dest neglects of big-endian
Date
The tipc multicast demo in tipcutils fails to work on big-endian hardware.
The tipc multicast server can not receive the packets sent by the multicast
client for that the dest port is always zero after tipc_dest_pop, then it
is found that the struct tipc_dest fails to take big/little endian into
account.

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
---
net/tipc/name_table.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index 0febba4..6e1e0ab 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -135,8 +135,13 @@ struct tipc_dest {
struct list_head list;
union {
struct {
+#ifdef __LITTLE_ENDIAN_BITFIELD
u32 port;
u32 node;
+#else /* __BIG_ENDIAN_BITFIELD */
+ u32 node;
+ u32 port;
+#endif
};
u64 value;
};
--
1.9.1
\
 
 \ /
  Last update: 2018-08-20 12:55    [W:0.045 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site