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.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index f2c011fd2ba1..bf692c1c116f 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/icmp.h> 14#include <linux/icmp.h>
16#include <linux/module.h> 15#include <linux/module.h>
@@ -51,15 +50,12 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
51 struct dccp_sock *dp = dccp_sk(sk); 50 struct dccp_sock *dp = dccp_sk(sk);
52 const struct sockaddr_in *usin = (struct sockaddr_in *)uaddr; 51 const struct sockaddr_in *usin = (struct sockaddr_in *)uaddr;
53 struct rtable *rt; 52 struct rtable *rt;
54 u32 daddr, nexthop; 53 __be32 daddr, nexthop;
55 int tmp; 54 int tmp;
56 int err; 55 int err;
57 56
58 dp->dccps_role = DCCP_ROLE_CLIENT; 57 dp->dccps_role = DCCP_ROLE_CLIENT;
59 58
60 if (dccp_service_not_initialized(sk))
61 return -EPROTO;
62
63 if (addr_len < sizeof(struct sockaddr_in)) 59 if (addr_len < sizeof(struct sockaddr_in))
64 return -EINVAL; 60 return -EINVAL;
65 61
@@ -502,11 +498,13 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
502 498
503 dccp_openreq_init(req, &dp, skb); 499 dccp_openreq_init(req, &dp, skb);
504 500
501 if (security_inet_conn_request(sk, skb, req))
502 goto drop_and_free;
503
505 ireq = inet_rsk(req); 504 ireq = inet_rsk(req);
506 ireq->loc_addr = daddr; 505 ireq->loc_addr = daddr;
507 ireq->rmt_addr = saddr; 506 ireq->rmt_addr = saddr;
508 req->rcv_wnd = 100; /* Fake, option parsing will get the 507 req->rcv_wnd = dccp_feat_default_sequence_window;
509 right value */
510 ireq->opt = NULL; 508 ireq->opt = NULL;
511 509
512 /* 510 /*
@@ -607,10 +605,10 @@ static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
607 if (req != NULL) 605 if (req != NULL)
608 return dccp_check_req(sk, skb, req, prev); 606 return dccp_check_req(sk, skb, req, prev);
609 607
610 nsk = __inet_lookup_established(&dccp_hashinfo, 608 nsk = inet_lookup_established(&dccp_hashinfo,
611 iph->saddr, dh->dccph_sport, 609 iph->saddr, dh->dccph_sport,
612 iph->daddr, ntohs(dh->dccph_dport), 610 iph->daddr, dh->dccph_dport,
613 inet_iif(skb)); 611 inet_iif(skb));
614 if (nsk != NULL) { 612 if (nsk != NULL) {
615 if (nsk->sk_state != DCCP_TIME_WAIT) { 613 if (nsk->sk_state != DCCP_TIME_WAIT) {
616 bh_lock_sock(nsk); 614 bh_lock_sock(nsk);
@@ -680,6 +678,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
680 } 678 }
681 }; 679 };
682 680
681 security_skb_classify_flow(skb, &fl);
683 if (ip_route_output_flow(&rt, &fl, sk, 0)) { 682 if (ip_route_output_flow(&rt, &fl, sk, 0)) {
684 IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); 683 IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
685 return NULL; 684 return NULL;
@@ -923,7 +922,7 @@ static int dccp_v4_rcv(struct sk_buff *skb)
923 * Look up flow ID in table and get corresponding socket */ 922 * Look up flow ID in table and get corresponding socket */
924 sk = __inet_lookup(&dccp_hashinfo, 923 sk = __inet_lookup(&dccp_hashinfo,
925 skb->nh.iph->saddr, dh->dccph_sport, 924 skb->nh.iph->saddr, dh->dccph_sport,
926 skb->nh.iph->daddr, ntohs(dh->dccph_dport), 925 skb->nh.iph->daddr, dh->dccph_dport,
927 inet_iif(skb)); 926 inet_iif(skb));
928 927
929 /* 928 /*