netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Yaple <yaplej@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: netfilter-devel <netfilter-devel@vger.kernel.org>
Subject: Re: Recalculate checksums in netfilter queue
Date: Wed, 21 Apr 2010 20:15:34 -0700	[thread overview]
Message-ID: <z2o8363055a1004212015w2216df48s3074cdb2328c66db@mail.gmail.com> (raw)
In-Reply-To: <x2t3fdd6ce01004201902x33440642rd1189d2852aa57a@mail.gmail.com>

> If you solve this problem, I'll be too grateful, because I'm looking
> for a solution since the last year in order to do NAT in userspace.
> Good luck.


If I get it figured out I will let you know.  Im kind of supprised
that there isnt a function for this in libnetfilter_queue already.  It
seems like it would be a pretty common requirement to recalculate the
tcp, and ip checksums.  I have spent two days trying to get something
to work without much luck.

My understanding is that the one complement of each 16-bit word is
summed, and then the result of that is bitwise complemented.

So for each word we would do something like this.
for each word{
     sum += ~word;
}

then you would take the bitwise complement of that total.
sum = ~sum;

  reply	other threads:[~2010-04-22  3:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21  1:02 Recalculate checksums in netfilter queue Justin Yaple
2010-04-21  2:02 ` Bruno Moreira Guedes
2010-04-22  3:15   ` Justin Yaple [this message]
2010-04-22 12:43     ` Morgon.J.Kanter
2010-04-22 20:19       ` Justin Yaple
     [not found]         ` <z2o3fdd6ce01004221432yec6c907bz4124144d403be1b4@mail.gmail.com>
2010-04-22 22:12           ` Justin Yaple
2010-04-22 19:37     ` James King

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=z2o8363055a1004212015w2216df48s3074cdb2328c66db@mail.gmail.com \
    --to=yaplej@gmail.com \
    --cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).