Skip to content

Commit 1980d37

Browse files
Hoang Ledavem330
authored andcommitted
tipc: convert dest node's address to network order
(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>
1 parent 1520929 commit 1980d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/netlink_compat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg,
696696
if (err)
697697
return err;
698698

699-
link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]);
699+
link_info.dest = htonl(nla_get_flag(link[TIPC_NLA_LINK_DEST]));
700700
link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP]));
701701
nla_strscpy(link_info.str, link[TIPC_NLA_LINK_NAME],
702702
TIPC_MAX_LINK_NAME);

0 commit comments

Comments
 (0)