Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202696
b: refs/heads/master
c: ed7865a
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 8, 2010
1 parent 5487343 commit b542f46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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: 9a57a9d291980302b4a3184fbc47dbddac71903e
refs/heads/master: ed7865a47d4759e85bbd7bed44bee411d868eaad
10 changes: 3 additions & 7 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,11 +1343,12 @@ static void rt_del(unsigned hash, struct rtable *rt)
spin_unlock_bh(rt_hash_lock_addr(hash));
}

/* called in rcu_read_lock() section */
void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
__be32 saddr, struct net_device *dev)
{
int i, k;
struct in_device *in_dev = in_dev_get(dev);
struct in_device *in_dev = __in_dev_get_rcu(dev);
struct rtable *rth, **rthp;
__be32 skeys[2] = { saddr, 0 };
int ikeys[2] = { dev->ifindex, 0 };
Expand Down Expand Up @@ -1383,7 +1384,6 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,

rthp=&rt_hash_table[hash].chain;

rcu_read_lock();
while ((rth = rcu_dereference(*rthp)) != NULL) {
struct rtable *rt;

Expand All @@ -1405,12 +1405,10 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
break;

dst_hold(&rth->u.dst);
rcu_read_unlock();

rt = dst_alloc(&ipv4_dst_ops);
if (rt == NULL) {
ip_rt_put(rth);
in_dev_put(in_dev);
return;
}

Expand Down Expand Up @@ -1463,12 +1461,10 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
ip_rt_put(rt);
goto do_next;
}
rcu_read_unlock();
do_next:
;
}
}
in_dev_put(in_dev);
return;

reject_redirect:
Expand All @@ -1479,7 +1475,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
&old_gw, dev->name, &new_gw,
&saddr, &daddr);
#endif
in_dev_put(in_dev);
;
}

static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst)
Expand Down

0 comments on commit b542f46

Please sign in to comment.