aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_fib.c
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2008-03-04 16:48:10 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-04 16:48:10 -0500
commitbdb3289f739e94bcae8b51972ae844ec66c2f4df (patch)
tree2ffffce475a82a69bbe8092be3d3f260fe83b003 /net/ipv6/ip6_fib.c
parent5578689a4e3c04f2d43ea39736fd3fa396d80c6e (diff)
[NETNS][IPV6] rt6_info - make rt6_info accessed as a pointer
This patch make mindless changes and prepares the code to use dynamic allocation for rt6_info structure. The code accesses the rt6_info structure as a pointer instead of a global static variable. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r--net/ipv6/ip6_fib.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 1c2566e3d392..f028f7a1a446 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -200,7 +200,7 @@ static struct fib6_table *fib6_alloc_table(u32 id)
200 table = kzalloc(sizeof(*table), GFP_ATOMIC); 200 table = kzalloc(sizeof(*table), GFP_ATOMIC);
201 if (table != NULL) { 201 if (table != NULL) {
202 table->tb6_id = id; 202 table->tb6_id = id;
203 table->tb6_root.leaf = &ip6_null_entry; 203 table->tb6_root.leaf = ip6_null_entry;
204 table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; 204 table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
205 } 205 }
206 206
@@ -717,8 +717,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
717 if (sfn == NULL) 717 if (sfn == NULL)
718 goto st_failure; 718 goto st_failure;
719 719
720 sfn->leaf = &ip6_null_entry; 720 sfn->leaf = ip6_null_entry;
721 atomic_inc(&ip6_null_entry.rt6i_ref); 721 atomic_inc(&ip6_null_entry->rt6i_ref);
722 sfn->fn_flags = RTN_ROOT; 722 sfn->fn_flags = RTN_ROOT;
723 sfn->fn_sernum = fib6_new_sernum(); 723 sfn->fn_sernum = fib6_new_sernum();
724 724
@@ -777,7 +777,7 @@ out:
777#if RT6_DEBUG >= 2 777#if RT6_DEBUG >= 2
778 if (!pn->leaf) { 778 if (!pn->leaf) {
779 BUG_TRAP(pn->leaf != NULL); 779 BUG_TRAP(pn->leaf != NULL);
780 pn->leaf = &ip6_null_entry; 780 pn->leaf = ip6_null_entry;
781 } 781 }
782#endif 782#endif
783 atomic_inc(&pn->leaf->rt6i_ref); 783 atomic_inc(&pn->leaf->rt6i_ref);
@@ -962,7 +962,7 @@ struct fib6_node * fib6_locate(struct fib6_node *root,
962static struct rt6_info * fib6_find_prefix(struct fib6_node *fn) 962static struct rt6_info * fib6_find_prefix(struct fib6_node *fn)
963{ 963{
964 if (fn->fn_flags&RTN_ROOT) 964 if (fn->fn_flags&RTN_ROOT)
965 return &ip6_null_entry; 965 return ip6_null_entry;
966 966
967 while(fn) { 967 while(fn) {
968 if(fn->left) 968 if(fn->left)
@@ -1012,7 +1012,7 @@ static struct fib6_node * fib6_repair_tree(struct fib6_node *fn)
1012#if RT6_DEBUG >= 2 1012#if RT6_DEBUG >= 2
1013 if (fn->leaf==NULL) { 1013 if (fn->leaf==NULL) {
1014 BUG_TRAP(fn->leaf); 1014 BUG_TRAP(fn->leaf);
1015 fn->leaf = &ip6_null_entry; 1015 fn->leaf = ip6_null_entry;
1016 } 1016 }
1017#endif 1017#endif
1018 atomic_inc(&fn->leaf->rt6i_ref); 1018 atomic_inc(&fn->leaf->rt6i_ref);
@@ -1154,7 +1154,7 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
1154 return -ENOENT; 1154 return -ENOENT;
1155 } 1155 }
1156#endif 1156#endif
1157 if (fn == NULL || rt == &ip6_null_entry) 1157 if (fn == NULL || rt == ip6_null_entry)
1158 return -ENOENT; 1158 return -ENOENT;
1159 1159
1160 BUG_TRAP(fn->fn_flags&RTN_RTINFO); 1160 BUG_TRAP(fn->fn_flags&RTN_RTINFO);
@@ -1501,7 +1501,7 @@ static int fib6_net_init(struct net *net)
1501 goto out_fib_table_hash; 1501 goto out_fib_table_hash;
1502 1502
1503 net->ipv6.fib6_main_tbl->tb6_id = RT6_TABLE_MAIN; 1503 net->ipv6.fib6_main_tbl->tb6_id = RT6_TABLE_MAIN;
1504 net->ipv6.fib6_main_tbl->tb6_root.leaf = &ip6_null_entry; 1504 net->ipv6.fib6_main_tbl->tb6_root.leaf = ip6_null_entry;
1505 net->ipv6.fib6_main_tbl->tb6_root.fn_flags = 1505 net->ipv6.fib6_main_tbl->tb6_root.fn_flags =
1506 RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; 1506 RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
1507 1507
@@ -1511,7 +1511,7 @@ static int fib6_net_init(struct net *net)
1511 if (!net->ipv6.fib6_local_tbl) 1511 if (!net->ipv6.fib6_local_tbl)
1512 goto out_fib6_main_tbl; 1512 goto out_fib6_main_tbl;
1513 net->ipv6.fib6_local_tbl->tb6_id = RT6_TABLE_LOCAL; 1513 net->ipv6.fib6_local_tbl->tb6_id = RT6_TABLE_LOCAL;
1514 net->ipv6.fib6_local_tbl->tb6_root.leaf = &ip6_null_entry; 1514 net->ipv6.fib6_local_tbl->tb6_root.leaf = ip6_null_entry;
1515 net->ipv6.fib6_local_tbl->tb6_root.fn_flags = 1515 net->ipv6.fib6_local_tbl->tb6_root.fn_flags =
1516 RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; 1516 RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
1517#endif 1517#endif