Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220948
b: refs/heads/master
c: 4aa2c46
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Oct 28, 2010
1 parent 791e1f8 commit cb16a1e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 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: b1424ed91076db0b19ba4141856150df9b717dde
refs/heads/master: 4aa2c466a7733af093a526e9d1cdd0b3b90d47e9
2 changes: 2 additions & 0 deletions trunk/include/net/ip_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ extern int fib_table_flush(struct fib_table *table);
extern void fib_table_select_default(struct fib_table *table,
const struct flowi *flp,
struct fib_result *res);
extern void fib_free_table(struct fib_table *tb);



#ifndef CONFIG_IP_MULTIPLE_TABLES
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ static void ip_fib_net_exit(struct net *net)
hlist_for_each_entry_safe(tb, node, tmp, head, tb_hlist) {
hlist_del(node);
fib_table_flush(tb);
kfree(tb);
fib_free_table(tb);
}
}
kfree(net->ipv4.fib_table_hash);
Expand Down
18 changes: 18 additions & 0 deletions trunk/net/ipv4/fib_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,24 @@ int fib_table_flush(struct fib_table *tb)
return found;
}

void fib_free_table(struct fib_table *tb)
{
struct fn_hash *table = (struct fn_hash *) tb->tb_data;
struct fn_zone *fz, *next;

next = table->fn_zone_list;
while (next != NULL) {
fz = next;
next = fz->fz_next;

if (fz->fz_hash != fz->fz_embedded_hash)
fz_hash_free(fz->fz_hash, fz->fz_divisor);

kfree(fz);
}

kfree(tb);
}

static inline int
fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb,
Expand Down
5 changes: 5 additions & 0 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,11 @@ int fib_table_flush(struct fib_table *tb)
return found;
}

void fib_free_table(struct fib_table *tb)
{
kfree(tb);
}

void fib_table_select_default(struct fib_table *tb,
const struct flowi *flp,
struct fib_result *res)
Expand Down

0 comments on commit cb16a1e

Please sign in to comment.