Merge branch 'ipv6_stable_privacy_address'
[firefly-linux-kernel-4.4.55.git] / include / net / sock.h
index f10832ca2e90a77b8dd0d340e567b12b981c96f2..3f9b8ce569481d758b5b2262c8baa2bc03462ca5 100644 (file)
@@ -67,6 +67,7 @@
 #include <linux/atomic.h>
 #include <net/dst.h>
 #include <net/checksum.h>
+#include <net/tcp_states.h>
 #include <linux/net_tstamp.h>
 
 struct cgroup;
@@ -404,8 +405,8 @@ struct sock {
        rwlock_t                sk_callback_lock;
        int                     sk_err,
                                sk_err_soft;
-       unsigned short          sk_ack_backlog;
-       unsigned short          sk_max_ack_backlog;
+       u32                     sk_ack_backlog;
+       u32                     sk_max_ack_backlog;
        __u32                   sk_priority;
 #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
        __u32                   sk_cgrp_prioidx;
@@ -2218,6 +2219,14 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
        return NULL;
 }
 
+/* This helper checks if a socket is a full socket,
+ * ie _not_ a timewait or request socket.
+ */
+static inline bool sk_fullsock(const struct sock *sk)
+{
+       return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
+}
+
 void sock_enable_timestamp(struct sock *sk, int flag);
 int sock_get_timestamp(struct sock *, struct timeval __user *);
 int sock_get_timestampns(struct sock *, struct timespec __user *);