Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261836AbVATUxK (ORCPT ); Thu, 20 Jan 2005 15:53:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261907AbVATUxK (ORCPT ); Thu, 20 Jan 2005 15:53:10 -0500 Received: from mail-gw4.njit.edu ([128.235.251.32]:62919 "EHLO mail-gw4.njit.edu") by vger.kernel.org with ESMTP id S261836AbVATUwi (ORCPT ); Thu, 20 Jan 2005 15:52:38 -0500 Date: Thu, 20 Jan 2005 15:52:34 -0500 (EST) From: Rahul Jain To: Kernel Traffic Mailing List Subject: TCP checksum calculation Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 978 Lines: 24 Hi, I have written a module that changes IP addrs and TCP port values. After changing these fields, I am able to recalculate the IP checksum within the module. To recalculate the TCP checksum, I wrote a new function in tcp_ipv4.c which is very similar to tcp_v4_send_check(). The only difference is that, my function does not use the sock parameter and gets the saddr and daddr from sk_buff. I call this function before the following piece of code in tcp_v4_rcv() if ((skb->ip_summed != CHECKSUM_UNNECESSARY && tcp_v4_checksum_init(skb) < 0)) goto bad_packet; However I am still getting a bad tcp checksum error. Does anyone know what I am missing and point me in the right direction. Thanks, Rahul. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/