netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Recalculate checksums in netfilter queue
@ 2010-04-21  1:02 Justin Yaple
  2010-04-21  2:02 ` Bruno Moreira Guedes
  0 siblings, 1 reply; 7+ messages in thread
From: Justin Yaple @ 2010-04-21  1:02 UTC (permalink / raw)
  To: netfilter-devel

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-22 22:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).