Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipv6: fix RTPROT_RA markup of RA routes
In some cases RA routes were not being correctly exported (this helps quagga in particular when default routes are around) Backported from net-next.
- Loading branch information
Dave Taht
committed
Aug 10, 2012
1 parent
69de781
commit 0b614f0
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
target/linux/generic/patches-3.3/051-ipv6-fix-RTPROT_RA-markup-of-RA-routes-w-nexthops.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From patchwork Tue Jul 10 14:45:50 2012 | ||
Content-Type: text/plain; charset="utf-8" | ||
MIME-Version: 1.0 | ||
Content-Transfer-Encoding: 7bit | ||
Subject: ipv6: fix RTPROT_RA markup of RA routes w/nexthops | ||
Date: Tue, 10 Jul 2012 04:45:50 -0000 | ||
From: Denis Ovsienko <infrastation@yandex.ru> | ||
X-Patchwork-Id: 170201 | ||
Message-Id: <20120710184550.7a5a8d89802473b4c28d07bf@yandex.ru> | ||
To: netdev@vger.kernel.org | ||
|
||
From: Denis Ovsienko <infrastation@yandex.ru> | ||
|
||
Userspace implementations of network routing protocols sometimes need to | ||
tell RA-originated IPv6 routes from other kernel routes to make proper | ||
routing decisions. This makes most sense for RA routes with nexthops, | ||
namely, default routes and Route Information routes. | ||
|
||
The intended mean of preserving RA route origin in a netlink message is | ||
through indicating RTPROT_RA as protocol code. Function rt6_fill_node() | ||
tried to do that for default routes, but its test condition was taken | ||
wrong. This change is modeled after the original mailing list posting | ||
by Jeff Haran. It fixes the test condition for default route case and | ||
sets the same behaviour for Route Information case (both types use | ||
nexthops). Handling of the 3rd RA route type, Prefix Information, is | ||
left unchanged, as it stands for interface connected routes (without | ||
nexthops). | ||
|
||
Signed-off-by: Denis Ovsienko <infrastation@yandex.ru> | ||
|
||
--- | ||
net/ipv6/route.c | 10 ++++++---- | ||
1 files changed, 6 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c | ||
index 999a982..238b1ee 100644 | ||
--- a/net/ipv6/route.c | ||
+++ b/net/ipv6/route.c | ||
@@ -2440,10 +2440,12 @@ static int rt6_fill_node(struct net *net, | ||
rtm->rtm_protocol = rt->rt6i_protocol; | ||
if (rt->rt6i_flags & RTF_DYNAMIC) | ||
rtm->rtm_protocol = RTPROT_REDIRECT; | ||
- else if (rt->rt6i_flags & RTF_ADDRCONF) | ||
- rtm->rtm_protocol = RTPROT_KERNEL; | ||
- else if (rt->rt6i_flags & RTF_DEFAULT) | ||
- rtm->rtm_protocol = RTPROT_RA; | ||
+ else if (rt->rt6i_flags & RTF_ADDRCONF) { | ||
+ if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ROUTEINFO)) | ||
+ rtm->rtm_protocol = RTPROT_RA; | ||
+ else | ||
+ rtm->rtm_protocol = RTPROT_KERNEL; | ||
+ } | ||
|
||
if (rt->rt6i_flags & RTF_CACHE) | ||
rtm->rtm_flags |= RTM_F_CLONED; |