aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-09-26 09:30:05 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:40 -0400
commit08831700cc65f85a497d6b32b1c83ca84d71de4a (patch)
tree419a08b43e529f211dbdc7224283ed560334b4b3 /net
parent53465eb4ab16660eab0a7be168a087a97172e650 (diff)
[DCCP]: Send Reset upon Sync in state REQUEST
This fixes the code to correspond to RFC 4340, 7.5.4, which states the exception that a Sync received in state REQUEST generates a Reset (not a SyncAck). To achieve this, only a small change is required. Since dccp_rcv_request_sent_state_process() already uses the correct Reset Code number 4 ("Packet Error"), we only need to shift the if-statement a few lines further down. (To test this case: replace DCCP_PKT_RESPONSE with DCCP_PKT_SYNC in dccp_make_response.) Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/input.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c
index cde0e704dfce..86ad3ba0649a 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -540,11 +540,6 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
540 return 0; 540 return 0;
541 } 541 }
542 542
543 if (unlikely(dh->dccph_type == DCCP_PKT_SYNC)) {
544 dccp_send_sync(sk, dcb->dccpd_seq, DCCP_PKT_SYNCACK);
545 goto discard;
546 }
547
548 switch (sk->sk_state) { 543 switch (sk->sk_state) {
549 case DCCP_CLOSED: 544 case DCCP_CLOSED:
550 dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; 545 dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
@@ -575,6 +570,9 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
575 sk_wake_async(sk, 0, POLL_OUT); 570 sk_wake_async(sk, 0, POLL_OUT);
576 break; 571 break;
577 } 572 }
573 } else if (unlikely(dh->dccph_type == DCCP_PKT_SYNC)) {
574 dccp_send_sync(sk, dcb->dccpd_seq, DCCP_PKT_SYNCACK);
575 goto discard;
578 } 576 }
579 577
580 if (!queued) { 578 if (!queued) {