From: Patrick McHardy <kaber@trash.net>
To: Martin Josefsson <gandalf@wlug.westbo.se>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Netfilter-devel <netfilter-devel@lists.netfilter.org>
Subject: Re: Checksum problem in tcp-window-tracking
Date: Sun, 13 Jun 2004 06:28:52 +0200 [thread overview]
Message-ID: <40CBD804.7060708@trash.net> (raw)
In-Reply-To: <1087068742.1019.53.camel@tux.rsn.bth.se>
Martin Josefsson wrote:
> Hi Jozsef
>
> Upgraded my kernel and started seeing lots of complaints from the
> tcp-window-tracking code.
>
> I only get the complaints on localhost<->localhost traffic, all other
> traffic is complaint-free and working great :)
>
> Jun 12 21:14:30 tux ip_conntrack_tcp: INVALID: bad T IN= OUT= MAC=
> SRC=127.0.0.1 DST=127.0.0.1 LEN=93 TOS=00 PREC=0x00 TTL=64 ID=6306 DF
> PROTO=TCP SPT=6667 DPT=32813 SEQ=2226635880 ACK=2237541190 WINDOW=4095
> ACK PSH URGP=0
>
> "bad T" can only be this code from unclean()
>
> /* Checksum invalid? Ignore. */
> /* FIXME: Source route IP option packets --RR */
> if (csum_tcpudp_magic(iph->saddr, iph->daddr,
> tcplen, IPPROTO_TCP,
> skb->ip_summed == CHECKSUM_HW
> ? skb->csum
> : skb_checksum(skb, iph->ihl*4, tcplen, 0))) {
> if (NET_RATELIMIT(ip_ct_tcp_log_invalid))
> nf_log_packet(PF_INET, 0, skb, NULL, NULL,
> "ip_conntrack_tcp: INVALID: "
> "bad TCP checksum ");
> return 1;
> }
>
> According to tcpdump the checksum is correct (otherwise we'd have a
> serious bug in the tcp-stack :)
>
> Any ideas?
>
It probably fails on the outgoing path, where the meaning of skb->csum
is different. When CHECKSUM_HW on an outgoing packet is set, the device
should compute and store the checksum at skb->h.raw + skb->csum. tcp
sets CHECKSUM_HW in tcp_sendmsg() and do_tcp_sendpages() when the device
has NETIF_F_NO_CSUM set. Using skb_checksum() unconditionally should
fix it.
Regards
Patrick
next prev parent reply other threads:[~2004-06-13 4:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-12 19:32 Checksum problem in tcp-window-tracking Martin Josefsson
2004-06-13 4:28 ` Patrick McHardy [this message]
2004-06-13 20:15 ` Jozsef Kadlecsik
2004-06-15 13:14 ` Jozsef Kadlecsik
2004-06-15 18:32 ` Patrick McHardy
2004-06-15 18:51 ` Martin Josefsson
2004-06-15 19:06 ` Jozsef Kadlecsik
2004-06-14 8:23 ` Jozsef Kadlecsik
2004-06-14 8:43 ` Martin Josefsson
2004-06-14 8:57 ` Jozsef Kadlecsik
2004-06-14 8:58 ` Martin Josefsson
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=40CBD804.7060708@trash.net \
--to=kaber@trash.net \
--cc=gandalf@wlug.westbo.se \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.