diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index fd9876087651..39112e75411c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -850,6 +850,7 @@ extern struct sock *sk_alloc(struct net *net, int family, | |||
850 | gfp_t priority, | 850 | gfp_t priority, |
851 | struct proto *prot); | 851 | struct proto *prot); |
852 | extern void sk_free(struct sock *sk); | 852 | extern void sk_free(struct sock *sk); |
853 | extern void sk_release_kernel(struct sock *sk); | ||
853 | extern struct sock *sk_clone(const struct sock *sk, | 854 | extern struct sock *sk_clone(const struct sock *sk, |
854 | const gfp_t priority); | 855 | const gfp_t priority); |
855 | 856 | ||
@@ -1333,6 +1334,18 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e | |||
1333 | } | 1334 | } |
1334 | #endif | 1335 | #endif |
1335 | 1336 | ||
1337 | /* | ||
1338 | * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace. | ||
1339 | * They should not hold a referrence to a namespace in order to allow | ||
1340 | * to stop it. | ||
1341 | * Sockets after sk_change_net should be released using sk_release_kernel | ||
1342 | */ | ||
1343 | static inline void sk_change_net(struct sock *sk, struct net *net) | ||
1344 | { | ||
1345 | put_net(sk->sk_net); | ||
1346 | sk->sk_net = net; | ||
1347 | } | ||
1348 | |||
1336 | extern void sock_enable_timestamp(struct sock *sk); | 1349 | extern void sock_enable_timestamp(struct sock *sk); |
1337 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 1350 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |
1338 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); | 1351 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); |