diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-16 19:58:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-16 19:58:33 -0400 |
commit | 0c10c5d96865ce611d6a780888eff0ef4fab358b (patch) | |
tree | ab1303166355b32730185445557623bec09a1dcb /net/dccp/ipv4.c | |
parent | 37f7f421cce13435fdc0d870caf51141e5ebf079 (diff) |
[DCCP]: More precisely set reset_code when sending RESET packets
Moving the setting of DCCP_SKB_CB(skb)->dccpd_reset_code to the places
where events happen that trigger sending a RESET packet.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 2afaa464e7f0..e09907d8b7da 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -669,12 +669,16 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
669 | struct dccp_request_sock *dreq; | 669 | struct dccp_request_sock *dreq; |
670 | const __u32 saddr = skb->nh.iph->saddr; | 670 | const __u32 saddr = skb->nh.iph->saddr; |
671 | const __u32 daddr = skb->nh.iph->daddr; | 671 | const __u32 daddr = skb->nh.iph->daddr; |
672 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); | ||
673 | __u8 reset_code = DCCP_RESET_CODE_TOO_BUSY; | ||
672 | struct dst_entry *dst = NULL; | 674 | struct dst_entry *dst = NULL; |
673 | 675 | ||
674 | /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */ | 676 | /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */ |
675 | if (((struct rtable *)skb->dst)->rt_flags & | 677 | if (((struct rtable *)skb->dst)->rt_flags & |
676 | (RTCF_BROADCAST | RTCF_MULTICAST)) | 678 | (RTCF_BROADCAST | RTCF_MULTICAST)) { |
679 | reset_code = DCCP_RESET_CODE_NO_CONNECTION; | ||
677 | goto drop; | 680 | goto drop; |
681 | } | ||
678 | 682 | ||
679 | /* | 683 | /* |
680 | * TW buckets are converted to open requests without | 684 | * TW buckets are converted to open requests without |
@@ -718,7 +722,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
718 | * dccp_create_openreq_child. | 722 | * dccp_create_openreq_child. |
719 | */ | 723 | */ |
720 | dreq = dccp_rsk(req); | 724 | dreq = dccp_rsk(req); |
721 | dreq->dreq_isr = DCCP_SKB_CB(skb)->dccpd_seq; | 725 | dreq->dreq_isr = dcb->dccpd_seq; |
722 | dreq->dreq_iss = dccp_v4_init_sequence(sk, skb); | 726 | dreq->dreq_iss = dccp_v4_init_sequence(sk, skb); |
723 | dreq->dreq_service = dccp_hdr_request(skb)->dccph_req_service; | 727 | dreq->dreq_service = dccp_hdr_request(skb)->dccph_req_service; |
724 | 728 | ||
@@ -735,6 +739,7 @@ drop_and_free: | |||
735 | __reqsk_free(req); | 739 | __reqsk_free(req); |
736 | drop: | 740 | drop: |
737 | DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS); | 741 | DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS); |
742 | dcb->dccpd_reset_code = reset_code; | ||
738 | return -1; | 743 | return -1; |
739 | } | 744 | } |
740 | 745 | ||
@@ -1005,7 +1010,6 @@ int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1005 | return 0; | 1010 | return 0; |
1006 | 1011 | ||
1007 | reset: | 1012 | reset: |
1008 | DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; | ||
1009 | dccp_v4_ctl_send_reset(skb); | 1013 | dccp_v4_ctl_send_reset(skb); |
1010 | discard: | 1014 | discard: |
1011 | kfree_skb(skb); | 1015 | kfree_skb(skb); |