From patchwork Sun Mar 27 06:27:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 88492 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2E1C1B6FAD for ; Sun, 27 Mar 2011 17:27:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565Ab1C0G1g (ORCPT ); Sun, 27 Mar 2011 02:27:36 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:50390 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373Ab1C0G1f (ORCPT ); Sun, 27 Mar 2011 02:27:35 -0400 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate02.web.de (Postfix) with ESMTP id 18E2019B22AB0; Sun, 27 Mar 2011 08:27:34 +0200 (CEST) Received: from [46.126.246.98] (helo=localhost) by smtp01.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #2) id 1Q3jRl-0000Si-00; Sun, 27 Mar 2011 08:27:33 +0200 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: bridge@lists.linux-foundation.org Cc: Stephen Hemminger , David Miller , YOSHIFUJI Hideaki , Herbert Xu , netdev@vger.kernel.org, =?utf-8?q?Linus=20L=C3=BCssing?= Subject: [PATCH] bridge: mcast snooping, fix IPv6 MLD checksum calculation Date: Sun, 27 Mar 2011 08:27:23 +0200 Message-Id: <1301207244-10428-2-git-send-email-linus.luessing@web.de> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301207244-10428-1-git-send-email-linus.luessing@web.de> References: <20110327034404.GC31916@Sellars> <1301207244-10428-1-git-send-email-linus.luessing@web.de> MIME-Version: 1.0 X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX1916ZXWltLPz0uXtURVmktXInsxJeAjiSk71dWC kUamJHtKt8aQfYJUz5pcjybZfH9ebkmGVerbj66BuPHklpZDaA DiE2eJSb6azdqAG0LsOQ== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In contrast to IGMP, the MLDv1/2 message checksum needs to include an IPv6 "pseudo-header" in the calculations (see RFC2710, section 3.3; RFC3810, section 5.1.2). The multicast snooping feature of the bridge code however did not take this "pseudo-header" into consideration for the checksum validation when parsing a snooped IPv6 MLDv1/2 message of another host, leading to possibly ignored, though valid MLDv1/2 messages. This commit shall fix this issue. Signed-off-by: Linus Lüssing --- net/bridge/br_multicast.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index f61eb2e..47fae4f 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1525,7 +1525,10 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, break; /*FALLTHROUGH*/ case CHECKSUM_NONE: - skb2->csum = 0; + skb2->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr, + &ip6h->daddr, + skb2->len, + nexthdr, 0)); if (skb_checksum_complete(skb2)) goto out; }