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 <[email protected]>
Signed-off-by: Zhenbo Gao <[email protected]>
---
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
From: Haiqing Bai <[email protected]>
Date: Mon, 20 Aug 2018 18:26:01 +0800
> 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 <[email protected]>
> Signed-off-by: Zhenbo Gao <[email protected]>
Jon and Ying, please review.
thank you.
Hi David,
Please hold this one for now.
///jon
> -----Original Message-----
> From: David Miller <[email protected]>
> Sent: Monday, 20 August, 2018 22:21
> To: [email protected]
> Cc: Jon Maloy <[email protected]>; [email protected]; [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH] tipc: fix issue that tipc_dest neglects of big-endian
>
> From: Haiqing Bai <[email protected]>
> Date: Mon, 20 Aug 2018 18:26:01 +0800
>
> > 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 <[email protected]>
> > Signed-off-by: Zhenbo Gao <[email protected]>
>
> Jon and Ying, please review.
>
> thank you.
Sorry, I am on vacation too. I agree with Jon. Please temporarily hold this patch. Once I am back, I will review it as soon as possible.
Sent from my iPhone
> On Aug 21, 2018, at 9:52 PM, Jon Maloy <[email protected]> wrote:
>
> Hi David,
> Please hold this one for now.
>
> ///jon
>
>> -----Original Message-----
>> From: David Miller <[email protected]>
>> Sent: Monday, 20 August, 2018 22:21
>> To: [email protected]
>> Cc: Jon Maloy <[email protected]>; [email protected]; [email protected]; [email protected]; linux-
>> [email protected]
>> Subject: Re: [PATCH] tipc: fix issue that tipc_dest neglects of big-endian
>>
>> From: Haiqing Bai <[email protected]>
>> Date: Mon, 20 Aug 2018 18:26:01 +0800
>>
>>> 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 <[email protected]>
>>> Signed-off-by: Zhenbo Gao <[email protected]>
>>
>> Jon and Ying, please review.
>>
>> thank you.