Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
[cascardo/ovs.git] / datapath / linux-2.6 / compat-2.6 / include / net / netlink.h
1 #ifndef __NET_NETLINK_WRAPPER_H
2 #define __NET_NETLINK_WRAPPER_H 1
3
4 #include_next <net/netlink.h>
5
6 #ifndef HAVE_NLA_NUL_STRING
7 #define NLA_NUL_STRING NLA_STRING
8
9 static inline int VERIFY_NUL_STRING(struct nlattr *attr)
10 {
11         return (!attr || (nla_len(attr)
12                           && memchr(nla_data(attr), '\0', nla_len(attr)))
13                 ? 0 : EINVAL);
14 }
15 #else
16 static inline int VERIFY_NUL_STRING(struct nlattr *attr)
17 {
18         return 0;
19 }
20 #endif  /* !HAVE_NLA_NUL_STRING */
21
22 #endif /* net/netlink.h */