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 16:25:47 +0800 [thread overview]
Message-ID: <4774B30B.3080507@cn.fujitsu.com> (raw)
In-Reply-To: <20071228.001510.239311334.davem@davemloft.net>
> From: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> Date: Fri, 28 Dec 2007 13:58:21 +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);
>>> }
>>>
>> 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 you said (still quoted above) that fn->leaf == NULL will not
> occur.
>
> Do you mean this, only in the case that the RTN_TL_ROOT flag is set?
yes, I mean this :-)
>
> I thought you meant always when the function is called, fn->leaf
> cannot ever be NULL.
its my fault, sorry for the inconvenient.
>
>
>
prev parent reply other threads:[~2007-12-28 8:25 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
2007-12-28 8:15 ` David Miller
2007-12-28 8:25 ` Gui Jianfeng [this message]
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=4774B30B.3080507@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 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).