[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A3D10BD.3050301@gmail.com>
Date: Sat, 20 Jun 2009 18:39:25 +0200
From: Jarek Poplawski <jarkao2@...il.com>
To: Neil Horman <nhorman@...driver.com>
CC: netdev@...r.kernel.org, mbizon@...ebox.fr, dada1@...mosbay.com,
kuznet@....inr.ac.ru, davem@...emloft.net, pekkas@...core.fi,
jmorris@...ei.org, yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH] fix NULL pointer + success return in route lookup path
Jarek Poplawski wrote, On 06/20/2009 02:37 PM:
> Neil Horman wrote, On 06/19/2009 07:18 PM:
>
>> Don't drop route if we're not caching
...
>> route.c | 14 ++++++++++++--
>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
>> index cd76b3c..65b3a8b 100644
>> --- a/net/ipv4/route.c
>> +++ b/net/ipv4/route.c
>> @@ -1085,8 +1085,16 @@ restart:
>> now = jiffies;
>>
>> if (!rt_caching(dev_net(rt->u.dst.dev))) {
>> - rt_drop(rt);
One more question: if this rt is assigned to an skb, there is only
skb_dst_drop() in kfree_skb(), but it seems we skip rt_free() part,
or I miss something?
Jarek P.
>> - return 0;
>> + /*
>> + * If we're not caching, just tell the caller we
>> + * were successful and don't touch the route. The
>> + * caller hold the sole reference to the cache entry, and
>> + * it will be released when the caller is done with it.
>> + * If we drop it here, the callers have no way to resolve routes
>> + * when we're not caching. Instead, just point *rp at rt, so
>> + * the caller gets a single use out of the route
>> + */
>> + goto report_and_exit;
>> }
>>
>> rthp = &rt_hash_table[hash].chain;
>> @@ -1217,6 +1225,8 @@ restart:
>> rcu_assign_pointer(rt_hash_table[hash].chain, rt);
>>
>> spin_unlock_bh(rt_hash_lock_addr(hash));
>> +
>> +report_and_exit:
>> if (rp)
>> *rp = rt;
>> else
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists