From: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: fib6_del_route has redundant code
Date: Fri, 28 Dec 2007 13:58:21 +0800 [thread overview]
Message-ID: <4774907D.5070806@cn.fujitsu.com> (raw)
In-Reply-To: <20071227.211808.221171928.davem@davemloft.net>
>> 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);
> }
>
Dave,
I think this block of code can't be removed, because just the root(default route)
fn->leaf always has ip6_null_entry on it. The normal fn->leaf becomes NULL when last
route has been deleted, the radix tree should be expunged.
> But I am not completely convinced that all of these lines
> of code can be removed :-)
>
>
--
Regards
Gui Jianfeng
--------------------------------------------------
Gui Jianfeng
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
TEL: +86+25-86630566-838
COINS: 79955-838
FAX: +86+25-83317685
MAIL:guijianfeng@cn.fujitsu.com
--------------------------------------------------
next prev parent reply other threads:[~2007-12-28 5:58 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
2007-12-28 5:58 ` Gui Jianfeng [this message]
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=4774907D.5070806@cn.fujitsu.com \
--to=guijianfeng@cn.fujitsu.com \
--cc=davem@davemloft.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.