aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-01 00:29:45 -0700
committerDavid S. Miller <davem@davemloft.net>2007-11-01 00:29:45 -0700
commitf1a6c4da14c365d3ee0b5de43a93f7470982637c (patch)
tree929b046ef28e1600cf08667459bd8c9a86069dc9 /net
parent261ab365fadd53ddc1b292b1663800e11fbf3e71 (diff)
[NET]: Move the sock_copy() from the header
The sock_copy() call is not used outside the sock.c file, so just move it into a sock.c Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index bba9949681f..fdacf9c8f1c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -857,6 +857,20 @@ static inline void sock_lock_init(struct sock *sk)
af_family_keys + sk->sk_family);
}
+static void sock_copy(struct sock *nsk, const struct sock *osk)
+{
+#ifdef CONFIG_SECURITY_NETWORK
+ void *sptr = nsk->sk_security;
+#endif
+
+ memcpy(nsk, osk, osk->sk_prot->obj_size);
+ get_net(nsk->sk_net);
+#ifdef CONFIG_SECURITY_NETWORK
+ nsk->sk_security = sptr;
+ security_sk_clone(osk, nsk);
+#endif
+}
+
/**
* sk_alloc - All socket objects are allocated here
* @net: the applicable net namespace