Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89799
b: refs/heads/master
c: a75e936
h: refs/heads/master
i:
  89797: 6cd8e70
  89795: e731237
  89791: c8b47ee
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Feb 29, 2008
1 parent 3c0d475 commit 295d1b4
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 642d6318119af60ac019524bd4edcfbd19d9d211
refs/heads/master: a75e936f2f1ba8428f70b204f3ddd3a7ff17d281
10 changes: 7 additions & 3 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ static unsigned int rt_hash_code(u32 daddr, u32 saddr)

#ifdef CONFIG_PROC_FS
struct rt_cache_iter_state {
struct seq_net_private p;
int bucket;
int genid;
};
Expand All @@ -285,7 +286,8 @@ static struct rtable *rt_cache_get_first(struct rt_cache_iter_state *st)
rcu_read_lock_bh();
r = rcu_dereference(rt_hash_table[st->bucket].chain);
while (r) {
if (r->rt_genid == st->genid)
if (r->u.dst.dev->nd_net == st->p.net &&
r->rt_genid == st->genid)
return r;
r = rcu_dereference(r->u.dst.rt_next);
}
Expand All @@ -312,6 +314,8 @@ static struct rtable *rt_cache_get_next(struct rt_cache_iter_state *st,
struct rtable *r)
{
while ((r = __rt_cache_get_next(st, r)) != NULL) {
if (r->u.dst.dev->nd_net != st->p.net)
continue;
if (r->rt_genid == st->genid)
break;
}
Expand Down Expand Up @@ -398,7 +402,7 @@ static const struct seq_operations rt_cache_seq_ops = {

static int rt_cache_seq_open(struct inode *inode, struct file *file)
{
return seq_open_private(file, &rt_cache_seq_ops,
return seq_open_net(inode, file, &rt_cache_seq_ops,
sizeof(struct rt_cache_iter_state));
}

Expand All @@ -407,7 +411,7 @@ static const struct file_operations rt_cache_seq_fops = {
.open = rt_cache_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
.release = seq_release_net,
};


Expand Down

0 comments on commit 295d1b4

Please sign in to comment.