Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154112
b: refs/heads/master
c: b6280b4
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Jun 23, 2009
1 parent 51a4ebf commit a7d69f3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d55d87fdff8252d0e2f7c28c2d443aee17e9d70f
refs/heads/master: b6280b47a7a42970d098a3059f4ebe7e55e90d8d
26 changes: 23 additions & 3 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,27 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,
* 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
* Note that we do rt_free on this new route entry, so that
* once its refcount hits zero, we are still able to reap it
* (Thanks Alexey)
* Note also the rt_free uses call_rcu. We don't actually
* need rcu protection here, this is just our path to get
* on the route gc list.
*/
goto report_and_exit;

if (rt->rt_type == RTN_UNICAST || rt->fl.iif == 0) {
int err = arp_bind_neighbour(&rt->u.dst);
if (err) {
if (net_ratelimit())
printk(KERN_WARNING
"Neighbour table failure & not caching routes.\n");
rt_drop(rt);
return err;
}
}

rt_free(rt);
goto skip_hashing;
}

rthp = &rt_hash_table[hash].chain;
Expand Down Expand Up @@ -1211,7 +1230,8 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,
#if RT_CACHE_DEBUG >= 2
if (rt->u.dst.rt_next) {
struct rtable *trt;
printk(KERN_DEBUG "rt_cache @%02x: %pI4", hash, &rt->rt_dst);
printk(KERN_DEBUG "rt_cache @%02x: %pI4",
hash, &rt->rt_dst);
for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next)
printk(" . %pI4", &trt->rt_dst);
printk("\n");
Expand All @@ -1226,7 +1246,7 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,

spin_unlock_bh(rt_hash_lock_addr(hash));

report_and_exit:
skip_hashing:
if (rp)
*rp = rt;
else
Expand Down

0 comments on commit a7d69f3

Please sign in to comment.