All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
@ 2011-08-24  6:10 Ang Way Chuang
  2011-08-24  7:18 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Ang Way Chuang @ 2011-08-24  6:10 UTC (permalink / raw)
  To: netdev; +Cc: Eric Dumazet

Just saw Eric's patch for icmp6_type. Suspect this patch may have issue for reference
of ip6h after pskb_trim_rcsum()?

Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my
testbed. This bug was made visible by commit ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.

This patch has been tested on 3.0.3. Due to lack of understanding on the checksum
optimization and multicast snooping of the kernel stack, can someone please verify the
correctness of this patch?

Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
---
index 2d85ca7..bbf361b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
 			break;
 		/*FALLTHROUGH*/
 	case CHECKSUM_NONE:
-		skb2->csum = 0;
-		if (skb_checksum_complete(skb2))
+		if (!skb_csum_unnecessary(skb2) && csum_ipv6_magic(&ip6h->saddr,
+			&ip6h->daddr, skb2->len, IPPROTO_ICMPV6,
+			skb_checksum(skb2, 0, skb2->len, 0))) {
+			err = -EINVAL;
 			goto out;
+		}
 	}
 
 	err = 0;
---

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

* Re: [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
  2011-08-24  6:10 [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Ang Way Chuang
@ 2011-08-24  7:18 ` Eric Dumazet
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2011-08-24  7:18 UTC (permalink / raw)
  To: Ang Way Chuang; +Cc: netdev

Le mercredi 24 août 2011 à 15:10 +0900, Ang Way Chuang a écrit :
> Just saw Eric's patch for icmp6_type. Suspect this patch may have issue for reference
> of ip6h after pskb_trim_rcsum()?
> 

I dont think so, because ip6h is against skb header, not skb2 one.


> Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
> Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my
> testbed. This bug was made visible by commit ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.
> 
> This patch has been tested on 3.0.3. Due to lack of understanding on the checksum
> optimization and multicast snooping of the kernel stack, can someone please verify the
> correctness of this patch?
> 
> Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
> ---
> index 2d85ca7..bbf361b 100644
> --- a/net/bridge/br_multicast.c
> +++ b/net/bridge/br_multicast.c
> @@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
>  			break;
>  		/*FALLTHROUGH*/
>  	case CHECKSUM_NONE:
> -		skb2->csum = 0;
> -		if (skb_checksum_complete(skb2))
> +		if (!skb_csum_unnecessary(skb2) && csum_ipv6_magic(&ip6h->saddr,
> +			&ip6h->daddr, skb2->len, IPPROTO_ICMPV6,
> +			skb_checksum(skb2, 0, skb2->len, 0))) {
> +			err = -EINVAL;
>  			goto out;
> +		}
>  	}
>  
>  	err = 0;
> ---


Sorry, I cannot comment on this, checksum games are hard :(

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

* Re: [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
  2011-08-24  4:56           ` [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Ang Way Chuang
@ 2011-08-24  5:06             ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-08-24  5:06 UTC (permalink / raw)
  To: wcang; +Cc: netdev, eric.dumazet, linus.luessing, herbert, yoshfuji, shemminger

From: Ang Way Chuang <wcang@sfc.wide.ad.jp>
Date: Wed, 24 Aug 2011 13:56:13 +0900

> @@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct
> net_bridge *br,
>              break;
>          /*FALLTHROUGH*/
>      case CHECKSUM_NONE:
> -        skb2->csum = 0;
> -        if (skb_checksum_complete(skb2))
> + if (!skb_csum_unnecessary(skb2) && csum_ipv6_magic(&ip6h->saddr,
> + &ip6h->daddr, skb2->len, IPPROTO_ICMPV6,

Patch has been significantly corrupted by your email client, making
it unusable for us.

Please read linux/Documentation/email-clients.txt, email a test patch
to yourself, and only resend your patch to this list once you can
successfully apply such a patch yourself.

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

* [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
  2011-08-23 17:24         ` Ang Way Chuang
@ 2011-08-24  4:56           ` Ang Way Chuang
  2011-08-24  5:06             ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Ang Way Chuang @ 2011-08-24  4:56 UTC (permalink / raw)
  To: netdev
  Cc: Eric Dumazet, Linus Lüssing, Herbert Xu, yoshfuji,
	Stephen Hemminger

Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my
testbed. This bug was made visible by commit ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.

This patch has been tested on 3.0.3. Due to lack of understanding on the checksum
optimization and multicast snooping of the kernel stack, can someone please verify the
correctness of this patch?

Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
---
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 2d85ca7..bbf361b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
              break;
          /*FALLTHROUGH*/
      case CHECKSUM_NONE:
-        skb2->csum = 0;
-        if (skb_checksum_complete(skb2))
+        if (!skb_csum_unnecessary(skb2) && csum_ipv6_magic(&ip6h->saddr,
+ &ip6h->daddr, skb2->len, IPPROTO_ICMPV6,
+            skb_checksum(skb2, 0, skb2->len, 0))) {
+            err = -EINVAL;
              goto out;
+        }
      }

      err = 0;
---

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

end of thread, other threads:[~2011-08-24  7:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24  6:10 [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Ang Way Chuang
2011-08-24  7:18 ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2011-08-23  8:41 IPv6 multicast snooping behaviour on 2.6.39-rc2 and later Ang Way Chuang
2011-08-23  9:57 ` Eric Dumazet
2011-08-23 12:31   ` Ang Way Chuang
2011-08-23 13:10     ` Eric Dumazet
2011-08-23 14:04       ` Ang Way Chuang
2011-08-23 17:24         ` Ang Way Chuang
2011-08-24  4:56           ` [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Ang Way Chuang
2011-08-24  5:06             ` David Miller

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.