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.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 731150d52799..a441c9cdd625 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -295,7 +295,8 @@ struct sock {
295 unsigned short sk_ack_backlog; 295 unsigned short sk_ack_backlog;
296 unsigned short sk_max_ack_backlog; 296 unsigned short sk_max_ack_backlog;
297 __u32 sk_priority; 297 __u32 sk_priority;
298 struct ucred sk_peercred; 298 struct pid *sk_peer_pid;
299 const struct cred *sk_peer_cred;
299 long sk_rcvtimeo; 300 long sk_rcvtimeo;
300 long sk_sndtimeo; 301 long sk_sndtimeo;
301 struct sk_filter *sk_filter; 302 struct sk_filter *sk_filter;
@@ -771,6 +772,7 @@ struct proto {
771 int *sysctl_wmem; 772 int *sysctl_wmem;
772 int *sysctl_rmem; 773 int *sysctl_rmem;
773 int max_header; 774 int max_header;
775 bool no_autobind;
774 776
775 struct kmem_cache *slab; 777 struct kmem_cache *slab;
776 unsigned int obj_size; 778 unsigned int obj_size;
@@ -1224,12 +1226,7 @@ static inline void sk_tx_queue_clear(struct sock *sk)
1224 1226
1225static inline int sk_tx_queue_get(const struct sock *sk) 1227static inline int sk_tx_queue_get(const struct sock *sk)
1226{ 1228{
1227 return sk->sk_tx_queue_mapping; 1229 return sk ? sk->sk_tx_queue_mapping : -1;
1228}
1229
1230static inline bool sk_tx_queue_recorded(const struct sock *sk)
1231{
1232 return (sk && sk->sk_tx_queue_mapping >= 0);
1233} 1230}
1234 1231
1235static inline void sk_set_socket(struct sock *sk, struct socket *sock) 1232static inline void sk_set_socket(struct sock *sk, struct socket *sock)
@@ -1711,19 +1708,13 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
1711static inline 1708static inline
1712struct net *sock_net(const struct sock *sk) 1709struct net *sock_net(const struct sock *sk)
1713{ 1710{
1714#ifdef CONFIG_NET_NS 1711 return read_pnet(&sk->sk_net);
1715 return sk->sk_net;
1716#else
1717 return &init_net;
1718#endif
1719} 1712}
1720 1713
1721static inline 1714static inline
1722void sock_net_set(struct sock *sk, struct net *net) 1715void sock_net_set(struct sock *sk, struct net *net)
1723{ 1716{
1724#ifdef CONFIG_NET_NS 1717 write_pnet(&sk->sk_net, net);
1725 sk->sk_net = net;
1726#endif
1727} 1718}
1728 1719
1729/* 1720/*