* [PATCH] IPv6: Default Route Support on Router
@ 2002-09-28 6:19 YOSHIFUJI Hideaki / 吉藤英明
2002-09-28 20:47 ` kuznet
0 siblings, 1 reply; 8+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2002-09-28 6:19 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: usagi
Hello.
When a Linux box is configured as a router (forwarding=1),
it does not recognize default routes.
We can't understand why Linux forbid to hold IPv6 default route
other than RA. We think IPv6 routers which use as edge router, not
backbone core router should accept IPv6 default route as default.
Because an edge router which doesn't speak BGP4+ may not have IPv6
full routes.
This patch changes the behavior and respects IPv6 default routes.
Following patch is against linux-2.4.19.
Thank you in advance.
-------------------------------------------------------------------
Patch-Name: Default Route Support on Router
Patch-Id: FIX_2_4_19_RTR_DEFROUTE-20020912
Patch-Author: YOSHIFUJI Hideaki / USAGI Project <yoshfuji@linux-ipv6.org>
Credit: Yuji SEKIYA / USAGI Project <sekiya@linux-ipv6.org>
-------------------------------------------------------------------
Index: net/ipv6/ip6_fib.c
===================================================================
RCS file: /cvsroot/usagi/usagi-backport/linux24/net/ipv6/ip6_fib.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.10.1
diff -u -r1.1.1.1 -r1.1.1.1.10.1
--- net/ipv6/ip6_fib.c 2002/08/20 09:47:02 1.1.1.1
+++ net/ipv6/ip6_fib.c 2002/09/12 01:49:00 1.1.1.1.10.1
@@ -13,6 +13,12 @@
* 2 of the License, or (at your option) any later version.
*/
+/*
+ * Changes:
+ * Yuji SEKIYA @USAGI: Support default route on router node;
+ * remove ip6_null_entry from the top of
+ * routing table.
+ */
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/types.h>
@@ -248,9 +254,6 @@
fn = root;
- if (plen == 0)
- return fn;
-
do {
key = (struct rt6key *)((u8 *)fn->leaf + offset);
@@ -427,6 +430,17 @@
ins = &fn->leaf;
+ if (fn->fn_flags&RTN_TL_ROOT &&
+ fn->leaf == &ip6_null_entry &&
+ !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF | RTF_ALLONLINK)) ){
+ /*
+ * The top fib of ip6 routing table includes ip6_null_entry.
+ */
+ fn->leaf = rt;
+ rt->u.next = NULL;
+ goto out;
+ }
+
for (iter = fn->leaf; iter; iter=iter->u.next) {
/*
* Search for duplicates
@@ -462,6 +476,7 @@
* insert node
*/
+out:
rt->u.next = iter;
*ins = rt;
rt->rt6i_node = fn;
@@ -675,7 +690,7 @@
fn = fib6_lookup_1(root, args);
- if (fn == NULL)
+ if (fn == NULL || fn->fn_flags & RTN_TL_ROOT)
fn = root;
return fn;
@@ -896,6 +911,9 @@
read_unlock(&fib6_walker_lock);
rt->u.next = NULL;
+
+ if (fn->leaf == NULL && fn->fn_flags&RTN_TL_ROOT)
+ fn->leaf = &ip6_null_entry;
/* If it was last route, expunge its radix tree node */
if (fn->leaf == NULL) {
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-28 6:19 [PATCH] IPv6: Default Route Support on Router YOSHIFUJI Hideaki / 吉藤英明
@ 2002-09-28 20:47 ` kuznet
2002-09-29 0:23 ` David S. Miller
2002-09-29 6:22 ` David S. Miller
0 siblings, 2 replies; 8+ messages in thread
From: kuznet @ 2002-09-28 20:47 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: netdev, Dave Miller
Hello!
> Following patch is against linux-2.4.19.
OK!
One question, what is this chunk for?
> @@ -675,7 +690,7 @@
>
> fn = fib6_lookup_1(root, args);
>
> - if (fn == NULL)
> + if (fn == NULL || fn->fn_flags & RTN_TL_ROOT)
> fn = root;
>
> return fn;
Alexey
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-28 20:47 ` kuznet
@ 2002-09-29 0:23 ` David S. Miller
2002-09-29 2:08 ` Andi Kleen
2002-09-29 2:09 ` kuznet
2002-09-29 6:22 ` David S. Miller
1 sibling, 2 replies; 8+ messages in thread
From: David S. Miller @ 2002-09-29 0:23 UTC (permalink / raw)
To: kuznet; +Cc: yoshfuji, netdev
From: kuznet@ms2.inr.ac.ru
Date: Sun, 29 Sep 2002 00:47:05 +0400 (MSD)
One question, what is this chunk for?
This reminds me, nothing is aparently going to make use
of net/ipv6/ip6_fw.c, it sits unused and untouched for
years, can we just detroy it? :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-29 0:23 ` David S. Miller
@ 2002-09-29 2:08 ` Andi Kleen
2002-09-29 2:09 ` kuznet
1 sibling, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2002-09-29 2:08 UTC (permalink / raw)
To: David S. Miller; +Cc: kuznet, yoshfuji, netdev
On Sat, Sep 28, 2002 at 05:23:06PM -0700, David S. Miller wrote:
> From: kuznet@ms2.inr.ac.ru
> Date: Sun, 29 Sep 2002 00:47:05 +0400 (MSD)
>
> One question, what is this chunk for?
>
> This reminds me, nothing is aparently going to make use
> of net/ipv6/ip6_fw.c, it sits unused and untouched for
> years, can we just detroy it? :-)
It never worked correctly and was unfinished. I would destroy it.
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-29 0:23 ` David S. Miller
2002-09-29 2:08 ` Andi Kleen
@ 2002-09-29 2:09 ` kuznet
2002-09-29 6:19 ` David S. Miller
1 sibling, 1 reply; 8+ messages in thread
From: kuznet @ 2002-09-29 2:09 UTC (permalink / raw)
To: David S. Miller; +Cc: yoshfuji, netdev
Hello!
> This reminds me, nothing is aparently going to make use
> of net/ipv6/ip6_fw.c, it sits unused and untouched for
> years,
... and unwritten. :-)
> can we just detroy it? :-)
Must, I think.
Though with your current mood about per-flow cache the file
could deserve... mmm... post-mortem examination. :-)
Alexey
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-29 2:09 ` kuznet
@ 2002-09-29 6:19 ` David S. Miller
2002-09-30 14:56 ` kuznet
0 siblings, 1 reply; 8+ messages in thread
From: David S. Miller @ 2002-09-29 6:19 UTC (permalink / raw)
To: kuznet; +Cc: yoshfuji, netdev
From: kuznet@ms2.inr.ac.ru
Date: Sun, 29 Sep 2002 06:09:52 +0400 (MSD)
> can we just detroy it? :-)
Must, I think.
Though with your current mood about per-flow cache the file
could deserve... mmm... post-mortem examination. :-)
Oh I see... perhaps you imply I should destroy CONFIG_RT6_POLICY
remnants as well? :-)
I think we should, the less clutter when hacking these things
the better.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-29 6:19 ` David S. Miller
@ 2002-09-30 14:56 ` kuznet
0 siblings, 0 replies; 8+ messages in thread
From: kuznet @ 2002-09-30 14:56 UTC (permalink / raw)
To: David S. Miller; +Cc: yoshfuji, netdev
Hello!
> Oh I see... perhaps you imply I should destroy CONFIG_RT6_POLICY
> remnants as well? :-)
Yes, the bits in route.c must be killed.
But I would prefer to preserve subtrees support in ip6_fib.c.
It is... well, it really constrains hacking, but in a useful manner,
not allowing to forget that a radix node may open second level lookup.
Alexey
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] IPv6: Default Route Support on Router
2002-09-28 20:47 ` kuznet
2002-09-29 0:23 ` David S. Miller
@ 2002-09-29 6:22 ` David S. Miller
1 sibling, 0 replies; 8+ messages in thread
From: David S. Miller @ 2002-09-29 6:22 UTC (permalink / raw)
To: kuznet; +Cc: yoshfuji, netdev
From: kuznet@ms2.inr.ac.ru
Date: Sun, 29 Sep 2002 00:47:05 +0400 (MSD)
> Following patch is against linux-2.4.19.
OK!
Patch is applied to both 2.4.x and 2.5.x
One question, what is this chunk for?
Once this is resolved, please send a patch if necessary.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-09-30 14:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-28 6:19 [PATCH] IPv6: Default Route Support on Router YOSHIFUJI Hideaki / 吉藤英明
2002-09-28 20:47 ` kuznet
2002-09-29 0:23 ` David S. Miller
2002-09-29 2:08 ` Andi Kleen
2002-09-29 2:09 ` kuznet
2002-09-29 6:19 ` David S. Miller
2002-09-30 14:56 ` kuznet
2002-09-29 6:22 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).