summaryrefslogtreecommitdiff
path: root/backport/backport-include/net/sock.h
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-12-04 22:16:22 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2016-02-18 22:14:39 +0100
commit6fb3580fa43faf7643f0460ad0cd288253c7983c (patch)
tree4b81b7c5a17c2533b1ede20b07a1eac6cce42016 /backport/backport-include/net/sock.h
parent005b70fd55bf066e13feba6eeacae463480dd5b8 (diff)
header: add sk_set_bit() and sk_clear_bit()
Upstream commit: 74ec2bcbe4e072baf6d7fc9d78be6df52cdf05cd This adds the sk_set_bit() and sk_clear_bit() functions in addition to the renaming of SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA. This is needed since upstream commit 9cd3e072b0be "net: rename SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA" Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport/backport-include/net/sock.h')
-rw-r--r--backport/backport-include/net/sock.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index caca6d1b..490b68cc 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -47,4 +47,20 @@
#define sk_alloc(net, family, priority, prot, kern) sk_alloc(net, family, priority, prot)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
+#define sk_set_bit LINUX_BACKPORT(sk_set_bit)
+static inline void sk_set_bit(int nr, struct sock *sk)
+{
+ set_bit(nr, &sk->sk_socket->flags);
+}
+#endif /* < 4.5 */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
+#define sk_clear_bit LINUX_BACKPORT(sk_clear_bit)
+static inline void sk_clear_bit(int nr, struct sock *sk)
+{
+ clear_bit(nr, &sk->sk_socket->flags);
+}
+#endif /* < 4.5 */
+
#endif /* __BACKPORT_NET_SOCK_H */