Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[sfrench/cifs-2.6.git] / include / net / sock.h
index 0a691ea7654aefb403e25039f08641691d3de74c..ac53bfbdfe16b57038cf6c0b7f88cc88f5221594 100644 (file)
@@ -195,7 +195,8 @@ struct sock_common {
   *    @sk_priority: %SO_PRIORITY setting
   *    @sk_type: socket type (%SOCK_STREAM, etc)
   *    @sk_protocol: which protocol this socket belongs in this network family
-  *    @sk_peercred: %SO_PEERCRED setting
+  *    @sk_peer_pid: &struct pid for this socket's peer
+  *    @sk_peer_cred: %SO_PEERCRED setting
   *    @sk_rcvlowat: %SO_RCVLOWAT setting
   *    @sk_rcvtimeo: %SO_RCVTIMEO setting
   *    @sk_sndtimeo: %SO_SNDTIMEO setting
@@ -211,6 +212,7 @@ struct sock_common {
   *    @sk_send_head: front of stuff to transmit
   *    @sk_security: used by security modules
   *    @sk_mark: generic packet mark
+  *    @sk_classid: this socket's cgroup classid
   *    @sk_write_pending: a write to stream socket waits to start
   *    @sk_state_change: callback to indicate change in the state of the sock
   *    @sk_data_ready: callback to indicate there is data to be processed
@@ -295,7 +297,8 @@ struct sock {
        unsigned short          sk_ack_backlog;
        unsigned short          sk_max_ack_backlog;
        __u32                   sk_priority;
-       struct ucred            sk_peercred;
+       struct pid              *sk_peer_pid;
+       const struct cred       *sk_peer_cred;
        long                    sk_rcvtimeo;
        long                    sk_sndtimeo;
        struct sk_filter        *sk_filter;
@@ -771,6 +774,7 @@ struct proto {
        int                     *sysctl_wmem;
        int                     *sysctl_rmem;
        int                     max_header;
+       bool                    no_autobind;
 
        struct kmem_cache       *slab;
        unsigned int            obj_size;
@@ -1706,19 +1710,13 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
 static inline
 struct net *sock_net(const struct sock *sk)
 {
-#ifdef CONFIG_NET_NS
-       return sk->sk_net;
-#else
-       return &init_net;
-#endif
+       return read_pnet(&sk->sk_net);
 }
 
 static inline
 void sock_net_set(struct sock *sk, struct net *net)
 {
-#ifdef CONFIG_NET_NS
-       sk->sk_net = net;
-#endif
+       write_pnet(&sk->sk_net, net);
 }
 
 /*