From: David Miller <davem@davemloft.net>
To: guijianfeng@cn.fujitsu.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: fib6_del_route has redundant code
Date: Thu, 27 Dec 2007 21:18:08 -0800 (PST) [thread overview]
Message-ID: <20071227.211808.221171928.davem@davemloft.net> (raw)
In-Reply-To: <477353B6.6000102@cn.fujitsu.com>
From: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Date: Thu, 27 Dec 2007 15:26:46 +0800
> I think the following code in fib6_del_route in the latest kernel is useless.
> 1125 if (fn->leaf == NULL && fn->fn_flags&RTN_TL_ROOT)
> 1126 fn->leaf = &ip6_null_entry;
>
> ip6_null_entry will never be unlinked from fn->leaf now, that is,
> fn->leaf == NULL will never meet.
I think you are right, but if it is true the next block of
code is dead too:
/* If it was last route, expunge its radix tree node */
if (fn->leaf == NULL) {
fn->fn_flags &= ~RTN_RTINFO;
rt6_stats.fib_route_nodes--;
fn = fib6_repair_tree(fn);
}
But I am not completely convinced that all of these lines
of code can be removed :-)
next prev parent reply other threads:[~2007-12-28 5:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-27 7:26 fib6_del_route has redundant code Gui Jianfeng
2007-12-28 5:18 ` David Miller [this message]
2007-12-28 5:58 ` Gui Jianfeng
2007-12-28 8:15 ` David Miller
2007-12-28 8:25 ` Gui Jianfeng
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=20071227.211808.221171928.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=guijianfeng@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).