git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75c8be3
)
datapath: Backport nla_put_be* functions.
author
Jesse Gross
<jesse@nicira.com>
Mon, 2 Apr 2012 20:41:20 +0000
(13:41 -0700)
committer
Jesse Gross
<jesse@nicira.com>
Mon, 2 Apr 2012 20:51:20 +0000
(13:51 -0700)
Linux 3.5 replaces the NLA_PUT_* functions with non-macro version,
which required adding the endian-typed versions. This backports
those functions and drops the macro backports.
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/include/net/netlink.h
patch
|
blob
|
history
diff --git
a/datapath/linux/compat/include/net/netlink.h
b/datapath/linux/compat/include/net/netlink.h
index
8bd6baa
..
14041e2
100644
(file)
--- a/
datapath/linux/compat/include/net/netlink.h
+++ b/
datapath/linux/compat/include/net/netlink.h
@@
-29,21
+29,6
@@
#define NLA_NESTED NLA_UNSPEC
#endif
#define NLA_NESTED NLA_UNSPEC
#endif
-#ifndef NLA_PUT_BE16
-#define NLA_PUT_BE16(skb, attrtype, value) \
- NLA_PUT_TYPE(skb, __be16, attrtype, value)
-#endif /* !NLA_PUT_BE16 */
-
-#ifndef NLA_PUT_BE32
-#define NLA_PUT_BE32(skb, attrtype, value) \
- NLA_PUT_TYPE(skb, __be32, attrtype, value)
-#endif /* !NLA_PUT_BE32 */
-
-#ifndef NLA_PUT_BE64
-#define NLA_PUT_BE64(skb, attrtype, value) \
- NLA_PUT_TYPE(skb, __be64, attrtype, value)
-#endif /* !NLA_PUT_BE64 */
-
#ifndef HAVE_NLA_GET_BE16
/**
* nla_get_be16 - return payload of __be16 attribute
#ifndef HAVE_NLA_GET_BE16
/**
* nla_get_be16 - return payload of __be16 attribute
@@
-100,6
+85,21
@@
static inline __be64 nla_get_be64(const struct nlattr *nla)
}
#endif
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be16), &value);
+}
+static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be32), &value);
+}
+static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be64), &value);
+}
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
/**
* nla_type - attribute type
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
/**
* nla_type - attribute type