aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-01 03:31:26 -0400
committerDavid S. Miller <davem@davemloft.net>2007-11-01 03:31:26 -0400
commit1e2e6b89f1d3152da0606d23e65e8760bf62a4c3 (patch)
tree75cbf6c0a5b2a0e708261d3799c7797a371f8a1d /net/core/sock.c
parentf1a6c4da14c365d3ee0b5de43a93f7470982637c (diff)
[NET]: Move the get_net() from sock_copy()
The sock_copy() is supposed to just clone the socket. In a perfect world it has to be just memcpy, but we have to handle the security mark correctly. All the extra setup must be performed in sk_clone() call, so move the get_net() into more proper place. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index fdacf9c8f1cb..9c2dbfaca60d 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -864,7 +864,6 @@ static void sock_copy(struct sock *nsk, const struct sock *osk)
864#endif 864#endif
865 865
866 memcpy(nsk, osk, osk->sk_prot->obj_size); 866 memcpy(nsk, osk, osk->sk_prot->obj_size);
867 get_net(nsk->sk_net);
868#ifdef CONFIG_SECURITY_NETWORK 867#ifdef CONFIG_SECURITY_NETWORK
869 nsk->sk_security = sptr; 868 nsk->sk_security = sptr;
870 security_sk_clone(osk, nsk); 869 security_sk_clone(osk, nsk);
@@ -958,6 +957,7 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
958 sock_copy(newsk, sk); 957 sock_copy(newsk, sk);
959 958
960 /* SANITY */ 959 /* SANITY */
960 get_net(newsk->sk_net);
961 sk_node_init(&newsk->sk_node); 961 sk_node_init(&newsk->sk_node);
962 sock_lock_init(newsk); 962 sock_lock_init(newsk);
963 bh_lock_sock(newsk); 963 bh_lock_sock(newsk);