diff options
author | Hoang Le <hoang.h.le@dektech.com.au> | 2021-03-11 10:33:22 +0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-19 10:12:52 +0200 |
commit | 3d1bede85632a6330bacb77a90eeeb5a956a78d0 (patch) | |
tree | aab6219ccbfbacf7e735211d28e581352999a4cc /net | |
parent | a407b5881686a3c08902d54d958e28f7bad4070a (diff) | |
download | linux-stable-3d1bede85632a6330bacb77a90eeeb5a956a78d0.tar.gz linux-stable-3d1bede85632a6330bacb77a90eeeb5a956a78d0.tar.bz2 linux-stable-3d1bede85632a6330bacb77a90eeeb5a956a78d0.zip |
tipc: convert dest node's address to network order
[ Upstream commit 1980d37565061ab44bdc2f9e4da477d3b9752e81 ]
(struct tipc_link_info)->dest is in network order (__be32), so we must
convert the value to network order before assigning. The problem detected
by sparse:
net/tipc/netlink_compat.c:699:24: warning: incorrect type in assignment (different base types)
net/tipc/netlink_compat.c:699:24: expected restricted __be32 [usertype] dest
net/tipc/netlink_compat.c:699:24: got int
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/tipc/netlink_compat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 1c7aa51cc2a3..49e893313652 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -693,7 +693,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, if (err) return err; - link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]); + link_info.dest = htonl(nla_get_flag(link[TIPC_NLA_LINK_DEST])); link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP])); nla_strlcpy(link_info.str, link[TIPC_NLA_LINK_NAME], TIPC_MAX_LINK_NAME); |