aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 0a691ea7654a..ac53bfbdfe16 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -195,7 +195,8 @@ struct sock_common {
195 * @sk_priority: %SO_PRIORITY setting 195 * @sk_priority: %SO_PRIORITY setting
196 * @sk_type: socket type (%SOCK_STREAM, etc) 196 * @sk_type: socket type (%SOCK_STREAM, etc)
197 * @sk_protocol: which protocol this socket belongs in this network family 197 * @sk_protocol: which protocol this socket belongs in this network family
198 * @sk_peercred: %SO_PEERCRED setting 198 * @sk_peer_pid: &struct pid for this socket's peer
199 * @sk_peer_cred: %SO_PEERCRED setting
199 * @sk_rcvlowat: %SO_RCVLOWAT setting 200 * @sk_rcvlowat: %SO_RCVLOWAT setting
200 * @sk_rcvtimeo: %SO_RCVTIMEO setting 201 * @sk_rcvtimeo: %SO_RCVTIMEO setting
201 * @sk_sndtimeo: %SO_SNDTIMEO setting 202 * @sk_sndtimeo: %SO_SNDTIMEO setting
@@ -211,6 +212,7 @@ struct sock_common {
211 * @sk_send_head: front of stuff to transmit 212 * @sk_send_head: front of stuff to transmit
212 * @sk_security: used by security modules 213 * @sk_security: used by security modules
213 * @sk_mark: generic packet mark 214 * @sk_mark: generic packet mark
215 * @sk_classid: this socket's cgroup classid
214 * @sk_write_pending: a write to stream socket waits to start 216 * @sk_write_pending: a write to stream socket waits to start
215 * @sk_state_change: callback to indicate change in the state of the sock 217 * @sk_state_change: callback to indicate change in the state of the sock
216 * @sk_data_ready: callback to indicate there is data to be processed 218 * @sk_data_ready: callback to indicate there is data to be processed
@@ -295,7 +297,8 @@ struct sock {
295 unsigned short sk_ack_backlog; 297 unsigned short sk_ack_backlog;
296 unsigned short sk_max_ack_backlog; 298 unsigned short sk_max_ack_backlog;
297 __u32 sk_priority; 299 __u32 sk_priority;
298 struct ucred sk_peercred; 300 struct pid *sk_peer_pid;
301 const struct cred *sk_peer_cred;
299 long sk_rcvtimeo; 302 long sk_rcvtimeo;
300 long sk_sndtimeo; 303 long sk_sndtimeo;
301 struct sk_filter *sk_filter; 304 struct sk_filter *sk_filter;
@@ -771,6 +774,7 @@ struct proto {
771 int *sysctl_wmem; 774 int *sysctl_wmem;
772 int *sysctl_rmem; 775 int *sysctl_rmem;
773 int max_header; 776 int max_header;
777 bool no_autobind;
774 778
775 struct kmem_cache *slab; 779 struct kmem_cache *slab;
776 unsigned int obj_size; 780 unsigned int obj_size;
@@ -1706,19 +1710,13 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
1706static inline 1710static inline
1707struct net *sock_net(const struct sock *sk) 1711struct net *sock_net(const struct sock *sk)
1708{ 1712{
1709#ifdef CONFIG_NET_NS 1713 return read_pnet(&sk->sk_net);
1710 return sk->sk_net;
1711#else
1712 return &init_net;
1713#endif
1714} 1714}
1715 1715
1716static inline 1716static inline
1717void sock_net_set(struct sock *sk, struct net *net) 1717void sock_net_set(struct sock *sk, struct net *net)
1718{ 1718{
1719#ifdef CONFIG_NET_NS 1719 write_pnet(&sk->sk_net, net);
1720 sk->sk_net = net;
1721#endif
1722} 1720}
1723 1721
1724/* 1722/*