linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tipc: fix issue that tipc_dest neglects of big-endian
@ 2018-08-20 10:26 Haiqing Bai
  2018-08-21  2:20 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Haiqing Bai @ 2018-08-20 10:26 UTC (permalink / raw)
  To: jon.maloy, ying.xue, davem, zhenbo.gao; +Cc: netdev, linux-kernel

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-21  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-20 10:26 [PATCH] tipc: fix issue that tipc_dest neglects of big-endian Haiqing Bai
2018-08-21  2:20 ` David Miller
2018-08-21  9:52   ` Jon Maloy
2018-08-21  9:57     ` Xue, Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).