lkml.org 
[lkml]   [2007]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fib6_del_route has redundant code
> 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.

>
>
>


\
 
 \ /
  Last update: 2007-12-28 09:29    [W:0.033 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site