aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_fib.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2014-11-19 05:32:12 -0500
committerJames Morris <james.l.morris@oracle.com>2014-11-19 05:32:12 -0500
commitb10778a00d40b3d9fdaaf5891e802794781ff71c (patch)
tree6ba4cbac86eecedc3f30650e7f764ecf00c83898 /net/ipv6/ip6_fib.c
parent594081ee7145cc30a3977cb4e218f81213b63dc5 (diff)
parentbfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff)
Merge commit 'v3.17' into next
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r--net/ipv6/ip6_fib.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index cb4459bd1d29..97b9fa8de377 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -643,7 +643,7 @@ static int fib6_commit_metrics(struct dst_entry *dst,
643 if (dst->flags & DST_HOST) { 643 if (dst->flags & DST_HOST) {
644 mp = dst_metrics_write_ptr(dst); 644 mp = dst_metrics_write_ptr(dst);
645 } else { 645 } else {
646 mp = kzalloc(sizeof(u32) * RTAX_MAX, GFP_KERNEL); 646 mp = kzalloc(sizeof(u32) * RTAX_MAX, GFP_ATOMIC);
647 if (!mp) 647 if (!mp)
648 return -ENOMEM; 648 return -ENOMEM;
649 dst_init_metrics(dst, mp, 0); 649 dst_init_metrics(dst, mp, 0);
@@ -1605,6 +1605,24 @@ static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
1605 fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL); 1605 fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL);
1606} 1606}
1607 1607
1608static int fib6_update_sernum(struct rt6_info *rt, void *arg)
1609{
1610 __u32 sernum = *(__u32 *)arg;
1611
1612 if (rt->rt6i_node &&
1613 rt->rt6i_node->fn_sernum != sernum)
1614 rt->rt6i_node->fn_sernum = sernum;
1615
1616 return 0;
1617}
1618
1619static void fib6_flush_trees(struct net *net)
1620{
1621 __u32 new_sernum = fib6_new_sernum();
1622
1623 fib6_clean_all(net, fib6_update_sernum, &new_sernum);
1624}
1625
1608/* 1626/*
1609 * Garbage collection 1627 * Garbage collection
1610 */ 1628 */
@@ -1788,6 +1806,8 @@ int __init fib6_init(void)
1788 NULL); 1806 NULL);
1789 if (ret) 1807 if (ret)
1790 goto out_unregister_subsys; 1808 goto out_unregister_subsys;
1809
1810 __fib6_flush_trees = fib6_flush_trees;
1791out: 1811out:
1792 return ret; 1812 return ret;
1793 1813