Commit 1980d375 authored by Hoang Le's avatar Hoang Le Committed by David S. Miller
Browse files

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: default avatarJon Maloy <jmaloy@redhat.com>
Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1520929e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -696,7 +696,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg,
	if (err)
	if (err)
		return 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]));
	link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP]));
	nla_strscpy(link_info.str, link[TIPC_NLA_LINK_NAME],
	nla_strscpy(link_info.str, link[TIPC_NLA_LINK_NAME],
		    TIPC_MAX_LINK_NAME);
		    TIPC_MAX_LINK_NAME);