From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haiqing Bai Subject: [PATCH] tipc: fix issue that tipc_dest neglects of big-endian Date: Mon, 20 Aug 2018 18:26:01 +0800 Message-ID: <1534760761-30206-1-git-send-email-Haiqing.Bai@windriver.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , To: , , , Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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 Signed-off-by: Zhenbo Gao --- 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