netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Newall <davidn@davidnewall.com>
To: Netdev <netdev@vger.kernel.org>
Subject: Re: Bad checksum on bridge with IP options
Date: Mon, 12 May 2014 22:53:19 +0930	[thread overview]
Message-ID: <5370CB47.4010400@davidnewall.com> (raw)
In-Reply-To: <536F8C0F.4090206@davidnewall.com>

I've got a patch which fixes the faulty checksums, and now ping works 
with RR or TS set.  I'm not quite sure, though, that it fixes the right 
thing.  I wonder if the problem is less that the checksum becomes wrong, 
and more that the route and timestamps ought not to be changed by the 
bridge interface.

Anyway, for discussion, here's the patch:

--- br_netfilter.c.orig	2014-05-12 22:10:59.809988125 +0930
+++ br_netfilter.c	2014-05-12 22:27:46.769299379 +0930
@@ -261,8 +261,10 @@
  static int br_parse_ip_options(struct sk_buff *skb)
  {
  	struct ip_options *opt;
-	const struct iphdr *iph;
+	struct iphdr *iph;
  	struct net_device *dev = skb->dev;
+	__sum16 oldsum;
+	int err;
  	u32 len;
  
  	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
@@ -298,8 +300,15 @@
  	if (iph->ihl == 5)
  		return 0;
  
+	oldsum = iph->check;
  	opt->optlen = iph->ihl*4 - sizeof(struct iphdr);
-	if (ip_options_compile(dev_net(dev), opt, skb))
+	err = ip_options_compile(dev_net(dev), opt, skb);
+	ip_send_check(iph);
+	if (iph->check != oldsum)
+		LIMIT_NETDEBUG(KERN_ERR
+			pr_fmt("br_parse_ip_options: bad sum %x replaced by %x\n"),
+			                       oldsum, iph->check);
+	if (err)
  		goto inhdr_error;
  
  	/* Check correct handling of SRR option */

  parent reply	other threads:[~2014-05-12 13:23 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11 14:41 Bad checksum on bridge with IP options David Newall
2014-05-11 19:42 ` Lukas Tribus
2014-05-12  8:14   ` David Newall
2014-05-12 10:15     ` Lukas Tribus
2014-05-12 10:25       ` David Newall
2014-05-12 10:31         ` Lukas Tribus
2014-05-12 10:48           ` David Newall
2014-05-12 13:23 ` David Newall [this message]
2014-05-12 13:51   ` Florian Westphal
2014-05-12 14:19     ` David Newall
2014-05-12 18:54   ` Lukas Tribus
2014-05-12 23:46     ` David Newall
2014-05-14 13:08       ` David Newall
2014-05-16 14:33         ` Revert 462fb2af9788a82a534f8184abfde31574e1cfa0 (bridge : Sanitize skb before it enters the IP stack) David Newall
2014-05-16 15:19           ` Eric Dumazet
2014-05-16 15:23             ` David Newall
2014-05-16 15:24             ` David Newall
2014-05-19 12:58           ` David Newall
2014-05-19 14:01             ` Florian Westphal
2014-05-19 14:19               ` David Newall
2014-05-19 17:09                 ` Florian Westphal
2014-05-19 20:49                   ` Bart De Schuymer
2014-05-21  7:49                     ` David Newall
2014-05-21 18:51                       ` Bart De Schuymer
2014-05-21 20:18                         ` David Miller
2014-05-22 18:57                           ` Bart De Schuymer
2014-05-24 18:00                             ` David Miller
2014-05-24  5:56                           ` David Newall
2014-05-24 17:43                             ` David Miller
2014-05-25  2:32                               ` David Newall
2014-05-25  3:02                                 ` David Miller
2014-05-25  6:37                                   ` David Newall
2014-05-27  8:55                                 ` David Laight
2014-05-29 22:34                                 ` David Miller
2014-05-30  9:17                                   ` David Newall
2014-05-31  0:46                                     ` David Miller
2014-05-31  6:13                                       ` David Newall
2014-05-31  6:37                                         ` David Miller
2014-05-22  3:50                         ` David Newall
2014-05-22 18:57                           ` Bart De Schuymer
2014-05-20  3:57                   ` David Newall
2014-05-20  4:55                 ` Valdis.Kletnieks
2014-05-20 16:05                   ` Vlad Yasevich
2014-05-21  8:10                   ` David Newall
2014-05-21 20:14                     ` David Miller
2014-05-22 20:06           ` Bandan Das

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=5370CB47.4010400@davidnewall.com \
    --to=davidn@davidnewall.com \
    --cc=netdev@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).