aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/minisocks.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /net/dccp/minisocks.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'net/dccp/minisocks.c')
-rw-r--r--net/dccp/minisocks.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index 662071b249c..d7041a0963a 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -53,15 +53,15 @@ void dccp_time_wait(struct sock *sk, int state, int timeo)
53 if (tw != NULL) { 53 if (tw != NULL) {
54 const struct inet_connection_sock *icsk = inet_csk(sk); 54 const struct inet_connection_sock *icsk = inet_csk(sk);
55 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); 55 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1);
56#if IS_ENABLED(CONFIG_IPV6) 56#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
57 if (tw->tw_family == PF_INET6) { 57 if (tw->tw_family == PF_INET6) {
58 const struct ipv6_pinfo *np = inet6_sk(sk); 58 const struct ipv6_pinfo *np = inet6_sk(sk);
59 struct inet6_timewait_sock *tw6; 59 struct inet6_timewait_sock *tw6;
60 60
61 tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot); 61 tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot);
62 tw6 = inet6_twsk((struct sock *)tw); 62 tw6 = inet6_twsk((struct sock *)tw);
63 tw6->tw_v6_daddr = np->daddr; 63 ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr);
64 tw6->tw_v6_rcv_saddr = np->rcv_saddr; 64 ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr);
65 tw->tw_ipv6only = np->ipv6only; 65 tw->tw_ipv6only = np->ipv6only;
66 } 66 }
67#endif 67#endif
@@ -100,7 +100,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
100 * (* Generate a new socket and switch to that socket *) 100 * (* Generate a new socket and switch to that socket *)
101 * Set S := new socket for this port pair 101 * Set S := new socket for this port pair
102 */ 102 */
103 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); 103 struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);
104 104
105 if (newsk != NULL) { 105 if (newsk != NULL) {
106 struct dccp_request_sock *dreq = dccp_rsk(req); 106 struct dccp_request_sock *dreq = dccp_rsk(req);
@@ -127,11 +127,9 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
127 * activation below, as these windows all depend on the local 127 * activation below, as these windows all depend on the local
128 * and remote Sequence Window feature values (7.5.2). 128 * and remote Sequence Window feature values (7.5.2).
129 */ 129 */
130 newdp->dccps_iss = dreq->dreq_iss; 130 newdp->dccps_gss = newdp->dccps_iss = dreq->dreq_iss;
131 newdp->dccps_gss = dreq->dreq_gss;
132 newdp->dccps_gar = newdp->dccps_iss; 131 newdp->dccps_gar = newdp->dccps_iss;
133 newdp->dccps_isr = dreq->dreq_isr; 132 newdp->dccps_gsr = newdp->dccps_isr = dreq->dreq_isr;
134 newdp->dccps_gsr = dreq->dreq_gsr;
135 133
136 /* 134 /*
137 * Activate features: initialise CCIDs, sequence windows etc. 135 * Activate features: initialise CCIDs, sequence windows etc.
@@ -166,15 +164,16 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb,
166 /* Check for retransmitted REQUEST */ 164 /* Check for retransmitted REQUEST */
167 if (dccp_hdr(skb)->dccph_type == DCCP_PKT_REQUEST) { 165 if (dccp_hdr(skb)->dccph_type == DCCP_PKT_REQUEST) {
168 166
169 if (after48(DCCP_SKB_CB(skb)->dccpd_seq, dreq->dreq_gsr)) { 167 if (after48(DCCP_SKB_CB(skb)->dccpd_seq, dreq->dreq_isr)) {
170 dccp_pr_debug("Retransmitted REQUEST\n"); 168 dccp_pr_debug("Retransmitted REQUEST\n");
171 dreq->dreq_gsr = DCCP_SKB_CB(skb)->dccpd_seq; 169 dreq->dreq_isr = DCCP_SKB_CB(skb)->dccpd_seq;
172 /* 170 /*
173 * Send another RESPONSE packet 171 * Send another RESPONSE packet
174 * To protect against Request floods, increment retrans 172 * To protect against Request floods, increment retrans
175 * counter (backoff, monitored by dccp_response_timer). 173 * counter (backoff, monitored by dccp_response_timer).
176 */ 174 */
177 inet_rtx_syn_ack(sk, req); 175 req->retrans++;
176 req->rsk_ops->rtx_syn_ack(sk, req, NULL);
178 } 177 }
179 /* Network Duplicate, discard packet */ 178 /* Network Duplicate, discard packet */
180 return NULL; 179 return NULL;
@@ -187,14 +186,12 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb,
187 goto drop; 186 goto drop;
188 187
189 /* Invalid ACK */ 188 /* Invalid ACK */
190 if (!between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, 189 if (DCCP_SKB_CB(skb)->dccpd_ack_seq != dreq->dreq_iss) {
191 dreq->dreq_iss, dreq->dreq_gss)) {
192 dccp_pr_debug("Invalid ACK number: ack_seq=%llu, " 190 dccp_pr_debug("Invalid ACK number: ack_seq=%llu, "
193 "dreq_iss=%llu, dreq_gss=%llu\n", 191 "dreq_iss=%llu\n",
194 (unsigned long long) 192 (unsigned long long)
195 DCCP_SKB_CB(skb)->dccpd_ack_seq, 193 DCCP_SKB_CB(skb)->dccpd_ack_seq,
196 (unsigned long long) dreq->dreq_iss, 194 (unsigned long long) dreq->dreq_iss);
197 (unsigned long long) dreq->dreq_gss);
198 goto drop; 195 goto drop;
199 } 196 }
200 197