From patchwork Fri Sep 3 13:04:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Graf X-Patchwork-Id: 63680 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 6EB29B717F for ; Fri, 3 Sep 2010 23:04:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537Ab0ICNEV (ORCPT ); Fri, 3 Sep 2010 09:04:21 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:55977 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325Ab0ICNEU (ORCPT ); Fri, 3 Sep 2010 09:04:20 -0400 Received: from tgr by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) id 1OrVwK-0005qi-1w; Fri, 03 Sep 2010 13:04:20 +0000 Date: Fri, 3 Sep 2010 09:04:20 -0400 From: Thomas Graf To: netdev@vger.kernel.org Cc: davem@vger.kernel.org, yoshfuji@linux-ipv6.org Subject: [PATCH] ipv6: add special mode forwarding=2 to send RS while configured as router Message-ID: <20100903130420.GB28460@bombadil.infradead.org> Mail-Followup-To: netdev@vger.kernel.org, davem@vger.kernel.org, yoshfuji@linux-ipv6.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Similar to accepting router advertisement, the IPv6 stack does not send router solicitations if forwarding is enabled. This patch enables this behavior to be overruled by setting forwarding to the special value 2. Signed-off-by: Thomas Graf --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-2.6/net/ipv6/addrconf.c =================================================================== --- net-2.6.orig/net/ipv6/addrconf.c +++ net-2.6/net/ipv6/addrconf.c @@ -2964,7 +2964,8 @@ static void addrconf_dad_completed(struc start sending router solicitations. */ - if (ifp->idev->cnf.forwarding == 0 && + if ((ifp->idev->cnf.forwarding == 0 || + ifp->idev->cnf.forwarding == 2) && ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {