[DCCP]: Dont use dccp_v4_checksum in dccp_make_response
authorArnaldo Carvalho de Melo <acme@mandriva.com>
Tue, 21 Mar 2006 05:23:59 +0000 (21:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 05:23:59 +0000 (21:23 -0800)
dccp_make_response is shared by ipv4/6 and the ipv6 code was
recalculating the checksum, not good, so move the dccp_v4_checksum
call to dccp_v4_send_response.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/ipv4.c
net/dccp/output.c

index 34d1b119b7208cc3c93ab9de7241a0b1c185c05d..f087593d64d30484b447b662196710e21ed73031 100644 (file)
@@ -264,7 +264,10 @@ static int dccp_v4_send_response(struct sock *sk, struct request_sock *req,
        skb = dccp_make_response(sk, dst, req);
        if (skb != NULL) {
                const struct inet_request_sock *ireq = inet_rsk(req);
+               struct dccp_hdr *dh = dccp_hdr(skb);
 
+               dh->dccph_checksum = dccp_v4_checksum(skb, ireq->loc_addr,
+                                                     ireq->rmt_addr);
                memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
                err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr,
                                            ireq->rmt_addr,
index 9922d2696b9c7036592605df04fdd99fd9f71ccd..6bd21e37686e0187017dcdeaa3700440c072797e 100644 (file)
@@ -314,9 +314,6 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
        dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), dreq->dreq_isr);
        dccp_hdr_response(skb)->dccph_resp_service = dreq->dreq_service;
 
-       dh->dccph_checksum = dccp_v4_checksum(skb, inet_rsk(req)->loc_addr,
-                                             inet_rsk(req)->rmt_addr);
-
        DCCP_INC_STATS(DCCP_MIB_OUTSEGS);
        return skb;
 }