aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r--net/dccp/input.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c
index b6cba72b44e8..bfc53665516b 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -32,7 +32,7 @@ static void dccp_fin(struct sock *sk, struct sk_buff *skb)
32 32
33static void dccp_rcv_close(struct sock *sk, struct sk_buff *skb) 33static void dccp_rcv_close(struct sock *sk, struct sk_buff *skb)
34{ 34{
35 dccp_v4_send_reset(sk, DCCP_RESET_CODE_CLOSED); 35 dccp_send_reset(sk, DCCP_RESET_CODE_CLOSED);
36 dccp_fin(sk, skb); 36 dccp_fin(sk, skb);
37 dccp_set_state(sk, DCCP_CLOSED); 37 dccp_set_state(sk, DCCP_CLOSED);
38 sk_wake_async(sk, 1, POLL_HUP); 38 sk_wake_async(sk, 1, POLL_HUP);
@@ -56,11 +56,11 @@ static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
56 dccp_send_close(sk, 0); 56 dccp_send_close(sk, 0);
57} 57}
58 58
59static inline void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) 59static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb)
60{ 60{
61 struct dccp_sock *dp = dccp_sk(sk); 61 struct dccp_sock *dp = dccp_sk(sk);
62 62
63 if (dp->dccps_options.dccpo_send_ack_vector) 63 if (dccp_msk(sk)->dccpms_send_ack_vector)
64 dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, 64 dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk,
65 DCCP_SKB_CB(skb)->dccpd_ack_seq); 65 DCCP_SKB_CB(skb)->dccpd_ack_seq);
66} 66}
@@ -151,9 +151,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
151 return 0; 151 return 0;
152} 152}
153 153
154static inline int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb, 154static int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
155 const struct dccp_hdr *dh, 155 const struct dccp_hdr *dh, const unsigned len)
156 const unsigned len)
157{ 156{
158 struct dccp_sock *dp = dccp_sk(sk); 157 struct dccp_sock *dp = dccp_sk(sk);
159 158
@@ -247,7 +246,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
247 if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) 246 if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
248 dccp_event_ack_recv(sk, skb); 247 dccp_event_ack_recv(sk, skb);
249 248
250 if (dp->dccps_options.dccpo_send_ack_vector && 249 if (dccp_msk(sk)->dccpms_send_ack_vector &&
251 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, 250 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk,
252 DCCP_SKB_CB(skb)->dccpd_seq, 251 DCCP_SKB_CB(skb)->dccpd_seq,
253 DCCP_ACKVEC_STATE_RECEIVED)) 252 DCCP_ACKVEC_STATE_RECEIVED))
@@ -300,7 +299,10 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
300 goto out_invalid_packet; 299 goto out_invalid_packet;
301 } 300 }
302 301
303 if (dp->dccps_options.dccpo_send_ack_vector && 302 if (dccp_parse_options(sk, skb))
303 goto out_invalid_packet;
304
305 if (dccp_msk(sk)->dccpms_send_ack_vector &&
304 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, 306 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk,
305 DCCP_SKB_CB(skb)->dccpd_seq, 307 DCCP_SKB_CB(skb)->dccpd_seq,
306 DCCP_ACKVEC_STATE_RECEIVED)) 308 DCCP_ACKVEC_STATE_RECEIVED))
@@ -321,14 +323,6 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
321 dccp_set_seqno(&dp->dccps_swl, 323 dccp_set_seqno(&dp->dccps_swl,
322 max48(dp->dccps_swl, dp->dccps_isr)); 324 max48(dp->dccps_swl, dp->dccps_isr));
323 325
324 if (ccid_hc_rx_init(dp->dccps_hc_rx_ccid, sk) != 0 ||
325 ccid_hc_tx_init(dp->dccps_hc_tx_ccid, sk) != 0) {
326 ccid_hc_rx_exit(dp->dccps_hc_rx_ccid, sk);
327 ccid_hc_tx_exit(dp->dccps_hc_tx_ccid, sk);
328 /* FIXME: send appropriate RESET code */
329 goto out_invalid_packet;
330 }
331
332 dccp_sync_mss(sk, icsk->icsk_pmtu_cookie); 326 dccp_sync_mss(sk, icsk->icsk_pmtu_cookie);
333 327
334 /* 328 /*
@@ -492,7 +486,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
492 if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) 486 if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
493 dccp_event_ack_recv(sk, skb); 487 dccp_event_ack_recv(sk, skb);
494 488
495 if (dp->dccps_options.dccpo_send_ack_vector && 489 if (dccp_msk(sk)->dccpms_send_ack_vector &&
496 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, 490 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk,
497 DCCP_SKB_CB(skb)->dccpd_seq, 491 DCCP_SKB_CB(skb)->dccpd_seq,
498 DCCP_ACKVEC_STATE_RECEIVED)) 492 DCCP_ACKVEC_STATE_RECEIVED))