projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c18ea70
)
datapath: Avoid nla_parse_nested const warning on < 2.6.22.
author
Jesse Gross
<jesse@nicira.com>
Mon, 31 Jan 2011 00:01:56 +0000
(16:01 -0800)
committer
Jesse Gross
<jesse@nicira.com>
Mon, 31 Jan 2011 06:16:37 +0000
(22:16 -0800)
We mark our Netlink policies as const for safety but the argument
to nla_parse_nested didn't become const until 2.6.22, which provokes
warnings. This casts away the constness on affected kernels to
avoid the warnings.
Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux-2.6/compat-2.6/include/net/netlink.h
patch
|
blob
|
history
diff --git
a/datapath/linux-2.6/compat-2.6/include/net/netlink.h
b/datapath/linux-2.6/compat-2.6/include/net/netlink.h
index f4fb8437b02145fc7e017149f112d2e933a8f7a8..0f881f1c8860a96e5a7dcd8660727d66b836d845 100644
(file)
--- a/
datapath/linux-2.6/compat-2.6/include/net/netlink.h
+++ b/
datapath/linux-2.6/compat-2.6/include/net/netlink.h
@@
-111,7
+111,10
@@
static inline int nla_type(const struct nlattr *nla)
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+#define nla_parse_nested(tb, maxtype, nla, policy) \
+ nla_parse_nested(tb, maxtype, (struct nlattr *)(nla), (struct nla_policy *)(policy))
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
#define nla_parse_nested(tb, maxtype, nla, policy) \
nla_parse_nested(tb, maxtype, (struct nlattr *)(nla), policy)
#endif