sctp: dubious bitfields in sctp_transport
[safe/jmp/linux-2.6] / include / net / sock.h
index cc7f91e..d2a71b0 100644 (file)
@@ -74,7 +74,7 @@
                                        printk(KERN_DEBUG msg); } while (0)
 #else
 /* Validate arguments and do nothing */
-static void inline int __attribute__ ((format (printf, 2, 3)))
+static inline void __attribute__ ((format (printf, 2, 3)))
 SOCK_DEBUG(struct sock *sk, const char *msg, ...)
 {
 }
@@ -177,6 +177,7 @@ struct sock_common {
   *               %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
   *    @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
   *    @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
+  *    @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
   *    @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
   *    @sk_gso_max_size: Maximum GSO segment size to build
   *    @sk_lingertime: %SO_LINGER l_linger setting
@@ -276,6 +277,7 @@ struct sock {
        int                     sk_forward_alloc;
        gfp_t                   sk_allocation;
        int                     sk_route_caps;
+       int                     sk_route_nocaps;
        int                     sk_gso_type;
        unsigned int            sk_gso_max_size;
        int                     sk_rcvlowat;
@@ -310,7 +312,7 @@ struct sock {
        void                    *sk_security;
 #endif
        __u32                   sk_mark;
-       /* XXX 4 bytes hole on 64 bit */
+       u32                     sk_classid;
        void                    (*sk_state_change)(struct sock *sk);
        void                    (*sk_data_ready)(struct sock *sk, int bytes);
        void                    (*sk_write_space)(struct sock *sk);
@@ -598,12 +600,15 @@ static inline int sk_stream_memory_free(struct sock *sk)
 /* OOB backlog add */
 static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
 {
-       if (!sk->sk_backlog.tail) {
-               sk->sk_backlog.head = sk->sk_backlog.tail = skb;
-       } else {
+       /* dont let skb dst not refcounted, we are going to leave rcu lock */
+       skb_dst_force(skb);
+
+       if (!sk->sk_backlog.tail)
+               sk->sk_backlog.head = skb;
+       else
                sk->sk_backlog.tail->next = skb;
-               sk->sk_backlog.tail = skb;
-       }
+
+       sk->sk_backlog.tail = skb;
        skb->next = NULL;
 }
 
@@ -1069,6 +1074,14 @@ extern void *sock_kmalloc(struct sock *sk, int size,
 extern void sock_kfree_s(struct sock *sk, void *mem, int size);
 extern void sk_send_sigurg(struct sock *sk);
 
+#ifdef CONFIG_CGROUPS
+extern void sock_update_classid(struct sock *sk);
+#else
+static inline void sock_update_classid(struct sock *sk)
+{
+}
+#endif
+
 /*
  * Functions to fill in entries in struct proto_ops when a protocol
  * does not implement a particular function.
@@ -1335,6 +1348,12 @@ static inline int sk_can_gso(const struct sock *sk)
 
 extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
 
+static inline void sk_nocaps_add(struct sock *sk, int flags)
+{
+       sk->sk_route_nocaps |= flags;
+       sk->sk_route_caps &= ~flags;
+}
+
 static inline int skb_copy_to_page(struct sock *sk, char __user *from,
                                   struct sk_buff *skb, struct page *page,
                                   int off, int copy)
@@ -1393,7 +1412,7 @@ static inline int sk_has_allocations(const struct sock *sk)
 
 /**
  * wq_has_sleeper - check if there are any waiting processes
- * @sk: struct socket_wq
+ * @wq: struct socket_wq
  *
  * Returns true if socket_wq has waiting processes
  *