From: David Miller <davem@davemloft.net>
To: Haiqing.Bai@windriver.com
Cc: netdev@vger.kernel.org, jon.maloy@ericsson.com,
ying.xue@windriver.com, zhenbo.gao@windriver.com,
linux-kernel@vger.kernel.org
Subject: Re: [V2][PATCH net] tipc: fix the big/little endian issue in tipc_dest
Date: Mon, 27 Aug 2018 15:24:02 -0700 (PDT) [thread overview]
Message-ID: <20180827.152402.1358178279473378697.davem@davemloft.net> (raw)
In-Reply-To: <1535333546-16753-1-git-send-email-Haiqing.Bai@windriver.com>
From: Haiqing Bai <Haiqing.Bai@windriver.com>
Date: Mon, 27 Aug 2018 09:32:26 +0800
> In function tipc_dest_push, the 32bit variables 'node' and 'port'
> are stored separately in uppper and lower part of 64bit 'value'.
> Then this value is assigned to dst->value which is a union like:
> union
> {
> struct {
> u32 port;
> u32 node;
> };
> u64 value;
> }
> This works on little-endian machines like x86 but fails on big-endian
> machines.
>
> The fix remove the 'value' stack parameter and even the 'value'
> member of the union in tipc_dest, assign the 'node' and 'port' member
> directly with the input parameter to avoid the endian issue.
>
> Fixes: a80ae5306a73 ("tipc: improve destination linked list")
>
> Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Applied and queued up for -stable.
prev parent reply other threads:[~2018-08-27 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 1:32 [V2][PATCH net] tipc: fix the big/little endian issue in tipc_dest Haiqing Bai
2018-08-27 22:24 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180827.152402.1358178279473378697.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Haiqing.Bai@windriver.com \
--cc=jon.maloy@ericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ying.xue@windriver.com \
--cc=zhenbo.gao@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).