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
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,
inet_register_protosw(&dccp_v4_protosw);
- err = inet_csk_ctl_sock_create(&socket, PF_INET,
- SOCK_DCCP, IPPROTO_DCCP);
+ err = inet_ctl_sock_create(&socket, PF_INET,
+ SOCK_DCCP, IPPROTO_DCCP);
if (err)
goto out_unregister_protosw;
dccp_v4_ctl_sk = socket->sk;
inet6_register_protosw(&dccp_v6_protosw);
- err = inet_csk_ctl_sock_create(&socket, PF_INET6,
- SOCK_DCCP, IPPROTO_DCCP);
+ err = inet_ctl_sock_create(&socket, PF_INET6,
+ SOCK_DCCP, IPPROTO_DCCP);
if (err != 0)
goto out_unregister_protosw;
dccp_v6_ctl_sk = socket->sk;
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;
EXPORT_SYMBOL_GPL(inet_csk_addr2sockaddr);
-int inet_csk_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_csk_ctl_sock_create);
-
#ifdef CONFIG_COMPAT
int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
void __init tcp_v4_init(void)
{
struct socket *__tcp_socket;
- if (inet_csk_ctl_sock_create(&__tcp_socket, PF_INET, SOCK_RAW,
- IPPROTO_TCP) < 0)
+ if (inet_ctl_sock_create(&__tcp_socket, PF_INET, SOCK_RAW,
+ IPPROTO_TCP) < 0)
panic("Failed to create the TCP control socket.\n");
tcp_sock = __tcp_socket->sk;
}
#include <net/dsfield.h>
#include <net/timewait_sock.h>
#include <net/netdma.h>
+#include <net/inet_common.h>
#include <asm/uaccess.h>
struct socket *sock;
struct sock *sk;
- err = inet_csk_ctl_sock_create(&sock, PF_INET6, SOCK_RAW, IPPROTO_TCP);
+ err = inet_ctl_sock_create(&sock, PF_INET6, SOCK_RAW, IPPROTO_TCP);
if (err)
return err;