What about a union?
///jon
-----Original Message-----
From: Eric Dumazet <redacted>
Sent: Friday, 29 June, 2018 09:58
To: Mohan Krishna Ghanta Krishnamurthy <redacted>; tipc-
discussion@lists.sourceforge.net; Jon Maloy [off-list ref]; maloy@donjonn.com; ying.xue@windriver.com;
netdev@vger.kernel.org; davem@davemloft.net
Cc: Parthasarathy Bhuvaragan <redacted>
Subject: Re: [net-next 2/3] tipc: implement socket diagnostics for AF_TIPC
On 03/21/2018 06:37 AM, GhantaKrishnamurthy MohanKrishna wrote:
quoted
This commit adds socket diagnostics capability for AF_TIPC in netlink
family NETLINK_SOCK_DIAG in a new kernel module (diag.ko).
...
quoted
+static u64 __tipc_diag_gen_cookie(struct sock *sk)
+{
+ u32 res[2];
+
+ sock_diag_save_cookie(sk, res);
+ return *((u64 *)res);
+}
I am pretty sure some combination of compiler / arch could be not happy
with this assumption that res[] is aligned to allow an u64 to be read like that.