diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/dccp/input.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r-- | net/dccp/input.c | 65 |
1 files changed, 22 insertions, 43 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c index 10c957a88f4f..4222e7a654b0 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -160,13 +160,15 @@ static void dccp_rcv_reset(struct sock *sk, struct sk_buff *skb) | |||
160 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); | 160 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); |
161 | } | 161 | } |
162 | 162 | ||
163 | static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) | 163 | static void dccp_handle_ackvec_processing(struct sock *sk, struct sk_buff *skb) |
164 | { | 164 | { |
165 | struct dccp_sock *dp = dccp_sk(sk); | 165 | struct dccp_ackvec *av = dccp_sk(sk)->dccps_hc_rx_ackvec; |
166 | 166 | ||
167 | if (dp->dccps_hc_rx_ackvec != NULL) | 167 | if (av == NULL) |
168 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, | 168 | return; |
169 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 169 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
170 | dccp_ackvec_clear_state(av, DCCP_SKB_CB(skb)->dccpd_ack_seq); | ||
171 | dccp_ackvec_input(av, skb); | ||
170 | } | 172 | } |
171 | 173 | ||
172 | static void dccp_deliver_input_to_ccids(struct sock *sk, struct sk_buff *skb) | 174 | static void dccp_deliver_input_to_ccids(struct sock *sk, struct sk_buff *skb) |
@@ -239,7 +241,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
239 | dccp_update_gsr(sk, seqno); | 241 | dccp_update_gsr(sk, seqno); |
240 | 242 | ||
241 | if (dh->dccph_type != DCCP_PKT_SYNC && | 243 | if (dh->dccph_type != DCCP_PKT_SYNC && |
242 | (ackno != DCCP_PKT_WITHOUT_ACK_SEQ)) | 244 | ackno != DCCP_PKT_WITHOUT_ACK_SEQ && |
245 | after48(ackno, dp->dccps_gar)) | ||
243 | dp->dccps_gar = ackno; | 246 | dp->dccps_gar = ackno; |
244 | } else { | 247 | } else { |
245 | unsigned long now = jiffies; | 248 | unsigned long now = jiffies; |
@@ -257,9 +260,9 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
257 | */ | 260 | */ |
258 | if (time_before(now, (dp->dccps_rate_last + | 261 | if (time_before(now, (dp->dccps_rate_last + |
259 | sysctl_dccp_sync_ratelimit))) | 262 | sysctl_dccp_sync_ratelimit))) |
260 | return 0; | 263 | return -1; |
261 | 264 | ||
262 | DCCP_WARN("DCCP: Step 6 failed for %s packet, " | 265 | DCCP_WARN("Step 6 failed for %s packet, " |
263 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " | 266 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " |
264 | "(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), " | 267 | "(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), " |
265 | "sending SYNC...\n", dccp_packet_name(dh->dccph_type), | 268 | "sending SYNC...\n", dccp_packet_name(dh->dccph_type), |
@@ -365,22 +368,13 @@ discard: | |||
365 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | 368 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
366 | const struct dccp_hdr *dh, const unsigned len) | 369 | const struct dccp_hdr *dh, const unsigned len) |
367 | { | 370 | { |
368 | struct dccp_sock *dp = dccp_sk(sk); | ||
369 | |||
370 | if (dccp_check_seqno(sk, skb)) | 371 | if (dccp_check_seqno(sk, skb)) |
371 | goto discard; | 372 | goto discard; |
372 | 373 | ||
373 | if (dccp_parse_options(sk, NULL, skb)) | 374 | if (dccp_parse_options(sk, NULL, skb)) |
374 | return 1; | 375 | return 1; |
375 | 376 | ||
376 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 377 | dccp_handle_ackvec_processing(sk, skb); |
377 | dccp_event_ack_recv(sk, skb); | ||
378 | |||
379 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
380 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
381 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
382 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
383 | goto discard; | ||
384 | dccp_deliver_input_to_ccids(sk, skb); | 378 | dccp_deliver_input_to_ccids(sk, skb); |
385 | 379 | ||
386 | return __dccp_rcv_established(sk, skb, dh, len); | 380 | return __dccp_rcv_established(sk, skb, dh, len); |
@@ -441,20 +435,14 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, | |||
441 | kfree_skb(sk->sk_send_head); | 435 | kfree_skb(sk->sk_send_head); |
442 | sk->sk_send_head = NULL; | 436 | sk->sk_send_head = NULL; |
443 | 437 | ||
444 | dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; | ||
445 | dccp_update_gsr(sk, dp->dccps_isr); | ||
446 | /* | 438 | /* |
447 | * SWL and AWL are initially adjusted so that they are not less than | 439 | * Set ISR, GSR from packet. ISS was set in dccp_v{4,6}_connect |
448 | * the initial Sequence Numbers received and sent, respectively: | 440 | * and GSS in dccp_transmit_skb(). Setting AWL/AWH and SWL/SWH |
449 | * SWL := max(GSR + 1 - floor(W/4), ISR), | 441 | * is done as part of activating the feature values below, since |
450 | * AWL := max(GSS - W' + 1, ISS). | 442 | * these settings depend on the local/remote Sequence Window |
451 | * These adjustments MUST be applied only at the beginning of the | 443 | * features, which were undefined or not confirmed until now. |
452 | * connection. | ||
453 | * | ||
454 | * AWL was adjusted in dccp_v4_connect -acme | ||
455 | */ | 444 | */ |
456 | dccp_set_seqno(&dp->dccps_swl, | 445 | dp->dccps_gsr = dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; |
457 | max48(dp->dccps_swl, dp->dccps_isr)); | ||
458 | 446 | ||
459 | dccp_sync_mss(sk, icsk->icsk_pmtu_cookie); | 447 | dccp_sync_mss(sk, icsk->icsk_pmtu_cookie); |
460 | 448 | ||
@@ -626,6 +614,9 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
626 | /* Caller (dccp_v4_do_rcv) will send Reset */ | 614 | /* Caller (dccp_v4_do_rcv) will send Reset */ |
627 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; | 615 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; |
628 | return 1; | 616 | return 1; |
617 | } else if (sk->sk_state == DCCP_CLOSED) { | ||
618 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; | ||
619 | return 1; | ||
629 | } | 620 | } |
630 | 621 | ||
631 | if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) { | 622 | if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) { |
@@ -638,15 +629,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
638 | if (dccp_parse_options(sk, NULL, skb)) | 629 | if (dccp_parse_options(sk, NULL, skb)) |
639 | return 1; | 630 | return 1; |
640 | 631 | ||
641 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 632 | dccp_handle_ackvec_processing(sk, skb); |
642 | dccp_event_ack_recv(sk, skb); | ||
643 | |||
644 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
645 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
646 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
647 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
648 | goto discard; | ||
649 | |||
650 | dccp_deliver_input_to_ccids(sk, skb); | 633 | dccp_deliver_input_to_ccids(sk, skb); |
651 | } | 634 | } |
652 | 635 | ||
@@ -688,10 +671,6 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
688 | } | 671 | } |
689 | 672 | ||
690 | switch (sk->sk_state) { | 673 | switch (sk->sk_state) { |
691 | case DCCP_CLOSED: | ||
692 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; | ||
693 | return 1; | ||
694 | |||
695 | case DCCP_REQUESTING: | 674 | case DCCP_REQUESTING: |
696 | queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len); | 675 | queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len); |
697 | if (queued >= 0) | 676 | if (queued >= 0) |