public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yan Zheng <yanzheng@21cn.com>
To: linux-kernel@vger.kernel.org
Subject: Question about CONFIG_IPV6_SUBTREES
Date: Mon, 10 Oct 2005 09:27:17 +0800	[thread overview]
Message-ID: <4349C375.4010106@21cn.com> (raw)

Hi all

In ip6_fib.c, fib6_lookup_1() does't make sense to me with 
CONFIG_IPV6_SUBTREES enable. It seem to only match source address when 
fib6_node has subtree. So I write a patch to show my opinion. 
unfortunately, this changes don't cooperate with  BACKTRACK() in route.c.

Can somebody explain the exact meaning of CONFIG_IPV6_SUBTREES!

Thanks.


--- linux-2.6.14-rc3-git8/net/ipv6/ip6_fib.c    2005-10-10 
08:57:40.000000000 +0800
+++ linux/net/ipv6/ip6_fib.c    2005-10-10 08:53:44.000000000 +0800
@@ -616,21 +616,6 @@
       }

       while ((fn->fn_flags & RTN_ROOT) == 0) {
-#ifdef CONFIG_IPV6_SUBTREES
-               if (fn->subtree) {
-                       struct fib6_node *st;
-                       struct lookup_args *narg;
-
-                       narg = args + 1;
-
-                       if (narg->addr) {
-                               st = fib6_lookup_1(fn->subtree, narg);
-
-                               if (st && !(st->fn_flags & RTN_ROOT))
-                                       return st;
-                       }
-               }
-#endif

               if (fn->fn_flags & RTN_RTINFO) {
                       struct rt6key *key;
@@ -639,7 +624,24 @@
                                       args->offset);

                       if (ipv6_prefix_equal(&key->addr, args->addr, 
key->plen))
-                               return fn;
+#ifdef CONFIG_IPV6_SUBTREES
+                               if (fn->subtree) {
+                                       struct fib6_node *st;
+                                       struct lookup_args *narg;
+
+                                       narg = args + 1;
+
+                                       if (narg->addr) {
+                                               st = 
fib6_lookup_1(fn->subtree, narg);
+
+                                               if (st && !(st->fn_flags 
& RTN_ROOT))
+                                                       return st;
+                                               if (fn->subtree->leaf != 
&ip6_null_entry)
+                                                       return fn->subtree;
+                                       }
+                               } else
+#endif
+                                       return fn;
               }

               fn = fn->parent;



                 reply	other threads:[~2005-10-10  1:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4349C375.4010106@21cn.com \
    --to=yanzheng@21cn.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox