aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index dad7bc4878e0..d4a166f0f391 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/dccp.h> 13#include <linux/dccp.h>
14#include <linux/icmp.h> 14#include <linux/icmp.h>
15#include <linux/slab.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/skbuff.h> 17#include <linux/skbuff.h>
17#include <linux/random.h> 18#include <linux/random.h>
@@ -104,7 +105,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
104 goto failure; 105 goto failure;
105 106
106 /* OK, now commit destination to socket. */ 107 /* OK, now commit destination to socket. */
107 sk_setup_caps(sk, &rt->u.dst); 108 sk_setup_caps(sk, &rt->dst);
108 109
109 dp->dccps_iss = secure_dccp_sequence_number(inet->inet_saddr, 110 dp->dccps_iss = secure_dccp_sequence_number(inet->inet_saddr,
110 inet->inet_daddr, 111 inet->inet_daddr,
@@ -348,7 +349,7 @@ static inline __sum16 dccp_v4_csum_finish(struct sk_buff *skb,
348 return csum_tcpudp_magic(src, dst, skb->len, IPPROTO_DCCP, skb->csum); 349 return csum_tcpudp_magic(src, dst, skb->len, IPPROTO_DCCP, skb->csum);
349} 350}
350 351
351void dccp_v4_send_check(struct sock *sk, int unused, struct sk_buff *skb) 352void dccp_v4_send_check(struct sock *sk, struct sk_buff *skb)
352{ 353{
353 const struct inet_sock *inet = inet_sk(sk); 354 const struct inet_sock *inet = inet_sk(sk);
354 struct dccp_hdr *dh = dccp_hdr(skb); 355 struct dccp_hdr *dh = dccp_hdr(skb);
@@ -474,7 +475,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
474 return NULL; 475 return NULL;
475 } 476 }
476 477
477 return &rt->u.dst; 478 return &rt->dst;
478} 479}
479 480
480static int dccp_v4_send_response(struct sock *sk, struct request_sock *req, 481static int dccp_v4_send_response(struct sock *sk, struct request_sock *req,
@@ -996,16 +997,16 @@ static struct inet_protosw dccp_v4_protosw = {
996 .flags = INET_PROTOSW_ICSK, 997 .flags = INET_PROTOSW_ICSK,
997}; 998};
998 999
999static int dccp_v4_init_net(struct net *net) 1000static int __net_init dccp_v4_init_net(struct net *net)
1000{ 1001{
1001 int err; 1002 if (dccp_hashinfo.bhash == NULL)
1003 return -ESOCKTNOSUPPORT;
1002 1004
1003 err = inet_ctl_sock_create(&net->dccp.v4_ctl_sk, PF_INET, 1005 return inet_ctl_sock_create(&net->dccp.v4_ctl_sk, PF_INET,
1004 SOCK_DCCP, IPPROTO_DCCP, net); 1006 SOCK_DCCP, IPPROTO_DCCP, net);
1005 return err;
1006} 1007}
1007 1008
1008static void dccp_v4_exit_net(struct net *net) 1009static void __net_exit dccp_v4_exit_net(struct net *net)
1009{ 1010{
1010 inet_ctl_sock_destroy(net->dccp.v4_ctl_sk); 1011 inet_ctl_sock_destroy(net->dccp.v4_ctl_sk);
1011} 1012}