mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rahul Jain <rbj2@oak.njit.edu>
To: Kernel Traffic Mailing List <linux-kernel@vger.kernel.org>
Subject: TCP checksum calculation
Date: Thu, 20 Jan 2005 15:52:34 -0500 (EST)	[thread overview]
Message-ID: <Pine.GSO.4.58.0501201541510.13444@chrome.njit.edu> (raw)

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.

             reply	other threads:[~2005-01-20 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 20:52 Rahul Jain [this message]
2005-01-20 23:32 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.58.0501201541510.13444@chrome.njit.edu \
    --to=rbj2@oak.njit.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®