From patchwork Tue May 19 07:56:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Mickael Guerin X-Patchwork-Id: 27390 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 9071DB7067 for ; Tue, 19 May 2009 18:27:23 +1000 (EST) Received: by ozlabs.org (Postfix) id 82137DE092; Tue, 19 May 2009 18:27:23 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 102B6DE08A for ; Tue, 19 May 2009 18:27:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750778AbZESI1P (ORCPT ); Tue, 19 May 2009 04:27:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750721AbZESI1O (ORCPT ); Tue, 19 May 2009 04:27:14 -0400 Received: from milan.magic.fr ([195.154.126.74]:40809 "EHLO milan.magic.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720AbZESI1N (ORCPT ); Tue, 19 May 2009 04:27:13 -0400 X-Greylist: delayed 1851 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 May 2009 04:27:13 EDT Received: from localhost (localhost [127.0.0.1]) by milan.magic.fr (Postfix) with ESMTP id 4F56119CD18 for ; Tue, 19 May 2009 09:55:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -2.499 X-Spam-Level: X-Spam-Status: No, score=-2.499 tagged_above=-10 required=14 tests=[AWL=0.000, BAYES_00=-2.599, RDNS_DYNAMIC=0.1] Received: from milan.magic.fr ([127.0.0.1]) by localhost (milan.magic.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zpmYVvqZrxEa for ; Tue, 19 May 2009 09:55:34 +0200 (CEST) Received: from [192.168.0.11] (xbn44-4-88-165-25-172.fbx.proxad.net [88.165.25.172]) by milan.magic.fr (Postfix) with ESMTP id 4A0EB19CD16 for ; Tue, 19 May 2009 09:55:34 +0200 (CEST) Message-ID: <4A12661F.1090301@6wind.com> Date: Tue, 19 May 2009 09:56:15 +0200 From: Jean-Mickael Guerin Organization: 6WIND User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: netdev@vger.kernel.org Subject: [PATCH] IPv6: set RTPROT_KERNEL to initial route Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, The use of unspecified protocol in IPv6 initial route prevents quagga to install IPv6 default route: # show ipv6 route S ::/0 [1/0] via fe80::1, eth1_0 K>* ::/0 is directly connected, lo, rej C>* ::1/128 is directly connected, lo C>* fe80::/64 is directly connected, eth1_0 # ip -6 route fe80::/64 dev eth1_0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit -1 ff00::/8 dev eth1_0 metric 256 mtu 1500 advmss 1440 hoplimit -1 unreachable default dev lo proto none metric -1 error -101 hoplimit 255 The attached patch ensures RTPROT_KERNEL to the default initial route and fixes the problem for quagga. This is similar to "ipv6: protocol for address routes" f410a1fba7afa79d2992620e874a343fdba28332. # show ipv6 route S>* ::/0 [1/0] via fe80::1, eth1_0 C>* ::1/128 is directly connected, lo C>* fe80::/64 is directly connected, eth1_0 # ip -6 route fe80::/64 dev eth1_0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit -1 fe80::/64 dev eth1_0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit -1 ff00::/8 dev eth1_0 metric 256 mtu 1500 advmss 1440 hoplimit -1 default via fe80::1 dev eth1_0 proto zebra metric 1024 mtu 1500 advmss 1440 hoplimit -1 unreachable default dev lo proto kernel metric -1 error -101 hoplimit 255 Regards, Jean-Mickael Signed-off-by: jean-mickael.guerin@6wind.com diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 32392d7..a7f9fb7 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -140,6 +140,7 @@ static struct rt6_info ip6_null_entry_template = { } }, .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), + .rt6i_protocol = RTPROT_KERNEL, .rt6i_metric = ~(u32) 0, .rt6i_ref = ATOMIC_INIT(1), }; @@ -162,6 +163,7 @@ static struct rt6_info ip6_prohibit_entry_template = { } }, .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), + .rt6i_protocol = RTPROT_KERNEL, .rt6i_metric = ~(u32) 0, .rt6i_ref = ATOMIC_INIT(1), }; @@ -179,6 +181,7 @@ static struct rt6_info ip6_blk_hole_entry_template = { } }, .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), + .rt6i_protocol = RTPROT_KERNEL, .rt6i_metric = ~(u32) 0, .rt6i_ref = ATOMIC_INIT(1), };