netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Moreira Guedes <thbmatrix@gmail.com>
To: Justin Yaple <yaplej@gmail.com>
Cc: netfilter-devel <netfilter-devel@vger.kernel.org>
Subject: Re: Recalculate checksums in netfilter queue
Date: Tue, 20 Apr 2010 23:02:09 -0300	[thread overview]
Message-ID: <x2t3fdd6ce01004201902x33440642rd1189d2852aa57a@mail.gmail.com> (raw)
In-Reply-To: <l2z8363055a1004201802x47a250f3ya43e4bec4e79061c@mail.gmail.com>

2010/4/20 Justin Yaple <yaplej@gmail.com>:
> Hello,
>
> I am having some trouble figuring out how to re-calculate the tcp/ip
> checksums after pulling a packet into user space with
> libnetfilter_queue.  In a netfilter hook I was able to use this:
> tcph->check = 0;
> tcph->check = tcp_v4_check(tcph, tcplen,
>        iph->saddr,
>        iph->daddr,
>        csum_partial((char *)tcph, tcplen, 0));
>        iph->check = 0;
>        ip_send_check(iph); //ip checksum
>
> In user space these functions tcp_v4_check(), csum_partial() and
> ip_send_check() do not exists.  Are there equivalent functions in user
> space so I can recalculate the ip/tcp checksums before passing the new
> packet back to the kernel with nfq_set_verdict()?
>
> Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Hello Justin!

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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-04-21  2:02 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 [this message]
2010-04-22  3:15   ` Justin Yaple
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=x2t3fdd6ce01004201902x33440642rd1189d2852aa57a@mail.gmail.com \
    --to=thbmatrix@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=yaplej@gmail.com \
    /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).