From patchwork Sun Feb 10 12:33:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Frederic Sowa X-Patchwork-Id: 219492 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 393EB2C0080 for ; Sun, 10 Feb 2013 23:34:10 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754351Ab3BJMdh (ORCPT ); Sun, 10 Feb 2013 07:33:37 -0500 Received: from order.stressinduktion.org ([87.106.68.36]:55319 "EHLO order.stressinduktion.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754219Ab3BJMdh (ORCPT ); Sun, 10 Feb 2013 07:33:37 -0500 Received: by order.stressinduktion.org (Postfix, from userid 500) id A43DF1A0CCB9; Sun, 10 Feb 2013 13:33:35 +0100 (CET) Date: Sun, 10 Feb 2013 13:33:35 +0100 From: Hannes Frederic Sowa To: netdev@vger.kernel.org Cc: yoshfuji@linux-ipv6.org, erik.hugne@ericsson.com Subject: [PATCH] ipv6: don't let node/interface scoped multicast traffic escape on the wire Message-ID: <20130210123335.GA18219@order.stressinduktion.org> Mail-Followup-To: netdev@vger.kernel.org, yoshfuji@linux-ipv6.org, erik.hugne@ericsson.com Mime-Version: 1.0 Content-Disposition: inline Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Reported-by: Erik Hugne Cc: Erik Hugne Cc: YOSHIFUJI Hideaki Signed-off-by: Hannes Frederic Sowa Acked-by: YOSHIFUJI Hideaki --- net/ipv6/ip6_output.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index c953825..155eccf 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -120,6 +120,13 @@ static int ip6_finish_output2(struct sk_buff *skb) IP6_UPD_PO_STATS(dev_net(dev), idev, IPSTATS_MIB_OUTMCAST, skb->len); + + if (IPV6_ADDR_MC_SCOPE(&ipv6_hdr(skb)->daddr) <= + IPV6_ADDR_SCOPE_NODELOCAL && + !(dev->flags & IFF_LOOPBACK)) { + kfree_skb(skb); + return 0; + } } rcu_read_lock_bh();