Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d58b5fa authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[INET]: Rename inet_csk_ctl_sock_create to inet_ctl_sock_create.



This call is nothing common with INET connection sockets code. It
simply creates an unhashes kernel sockets for protocol messages.

Move the new call into af_inet.c after the rename.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f049b4f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,11 @@ extern int inet_getname(struct socket *sock,
extern int			inet_ioctl(struct socket *sock, 
					   unsigned int cmd, unsigned long arg);

extern int			inet_ctl_sock_create(struct socket **sock,
						     unsigned short family,
						     unsigned short type,
						     unsigned char protocol);

#endif

+0 −5
Original line number Diff line number Diff line
@@ -327,11 +327,6 @@ extern void inet_csk_listen_stop(struct sock *sk);

extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);

extern int inet_csk_ctl_sock_create(struct socket **sock,
				    unsigned short family,
				    unsigned short type,
				    unsigned char protocol);

extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,
				      char __user *optval, int __user *optlen);
extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname,
+2 −2
Original line number Diff line number Diff line
@@ -1003,7 +1003,7 @@ static int __init dccp_v4_init(void)

	inet_register_protosw(&dccp_v4_protosw);

	err = inet_csk_ctl_sock_create(&socket, PF_INET,
	err = inet_ctl_sock_create(&socket, PF_INET,
				   SOCK_DCCP, IPPROTO_DCCP);
	if (err)
		goto out_unregister_protosw;
+2 −2
Original line number Diff line number Diff line
@@ -1185,7 +1185,7 @@ static int __init dccp_v6_init(void)

	inet6_register_protosw(&dccp_v6_protosw);

	err = inet_csk_ctl_sock_create(&socket, PF_INET6,
	err = inet_ctl_sock_create(&socket, PF_INET6,
				   SOCK_DCCP, IPPROTO_DCCP);
	if (err != 0)
		goto out_unregister_protosw;
+19 −0
Original line number Diff line number Diff line
@@ -1250,6 +1250,25 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
	return segs;
}

int inet_ctl_sock_create(struct socket **sock, unsigned short family,
			 unsigned short type, unsigned char protocol)
{
	int rc = sock_create_kern(family, type, protocol, sock);

	if (rc == 0) {
		(*sock)->sk->sk_allocation = GFP_ATOMIC;
		inet_sk((*sock)->sk)->uc_ttl = -1;
		/*
		 * Unhash it so that IP input processing does not even see it,
		 * we do not wish this socket to see incoming packets.
		 */
		(*sock)->sk->sk_prot->unhash((*sock)->sk);
	}
	return rc;
}

EXPORT_SYMBOL_GPL(inet_ctl_sock_create);

unsigned long snmp_fold_field(void *mib[], int offt)
{
	unsigned long res = 0;
Loading