mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
[ICSK]: Introduce inet_csk_ctl_sock_create
Consolidating open coded sequences in tcp and dccp, v4 and v6. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7247887357
commit
c4d9390941
6 changed files with 31 additions and 71 deletions
|
@ -1605,21 +1605,12 @@ static struct inet_protosw tcpv6_protosw = {
|
|||
|
||||
void __init tcpv6_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
/* register inet6 protocol */
|
||||
if (inet6_add_protocol(&tcpv6_protocol, IPPROTO_TCP) < 0)
|
||||
printk(KERN_ERR "tcpv6_init: Could not register protocol\n");
|
||||
inet6_register_protosw(&tcpv6_protosw);
|
||||
|
||||
err = sock_create_kern(PF_INET6, SOCK_RAW, IPPROTO_TCP, &tcp6_socket);
|
||||
if (err < 0)
|
||||
if (inet_csk_ctl_sock_create(&tcp6_socket, PF_INET6, SOCK_RAW,
|
||||
IPPROTO_TCP) < 0)
|
||||
panic("Failed to create the TCPv6 control socket.\n");
|
||||
tcp6_socket->sk->sk_allocation = GFP_ATOMIC;
|
||||
|
||||
/* Unhash it so that IP input processing does not even
|
||||
* see it, we do not wish this socket to see incoming
|
||||
* packets.
|
||||
*/
|
||||
tcp6_socket->sk->sk_prot->unhash(tcp6_socket->sk);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue