[DCCP]: Sequence number wrap-around when sending reset
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Wed, 26 Sep 2007 14:32:49 +0000 (11:32 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:52:43 +0000 (16:52 -0700)
This replaces normal addition with mod-48 addition so that sequence number
wraparound is respected.

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>
net/dccp/ipv4.c
net/dccp/ipv6.c

index 2c628281526473ef0b268c73b85b0a40b227b415..58a79c2ae55cc3fab1104da5f2e8b91291d52ae2 100644 (file)
@@ -552,7 +552,7 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
 
        /* See "8.3.1. Abnormal Termination" in RFC 4340 */
        if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
-               dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
+               seqno = ADD48(DCCP_SKB_CB(rxskb)->dccpd_ack_seq, 1);
 
        dccp_hdr_set_seq(dh, seqno);
        dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), DCCP_SKB_CB(rxskb)->dccpd_seq);
index b158c661867bb128d7f182e0c215e6836f710f36..d954e8319dbd30b2f4f0f3176f5cb0d7749b10f8 100644 (file)
@@ -336,7 +336,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
 
        /* See "8.3.1. Abnormal Termination" in RFC 4340 */
        if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
-               dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
+               seqno = ADD48(DCCP_SKB_CB(rxskb)->dccpd_ack_seq, 1);
 
        dccp_hdr_set_seq(dh, seqno);
        dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), DCCP_SKB_CB(rxskb)->dccpd_seq);