[ovs-dev] [PATCH] openvswitch.h: Note that 64 bit ints are 4-aligned.

Jarno Rajahalme jrajahalme at nicira.com
Fri Apr 11 19:52:05 UTC 2014


In general, all Netlink 64-bit data may be 4-byte aligned, due to
netlink header and attributes being 4-aligned.

To avoid unaligned access the data should be copied out of the netlink
attribute before access.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
---
 include/linux/openvswitch.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index a88f6f1..603382e 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -109,6 +109,7 @@ enum ovs_datapath_attr {
 
 #define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
 
+/* All 64-bit integers within Netlink messages are 4-byte aligned only. */
 struct ovs_dp_stats {
 	__u64 n_hit;             /* Number of flow table matches. */
 	__u64 n_missed;          /* Number of flow table misses. */
-- 
1.7.10.4




More information about the dev mailing list