aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_fib.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-22 03:01:08 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:12 -0400
commit86872cb57925c46a6499887d77afb880a892c0ec (patch)
treebc0442efb85226adac5c7ae43e632639dd1b6899 /net/ipv6/ip6_fib.c
parent40e22e8f3d4d4f1ff68fb03683f007c53ee8b348 (diff)
[IPv6] route: FIB6 configuration using struct fib6_config
Replaces the struct in6_rtmsg based interface orignating from the ioctl interface with a struct fib6_config based on. Allows changing the interface without breaking the ioctl interface and avoids passing on tons of parameters. The recently introduced struct nl_info is used to pass on netlink authorship information for notifications. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r--net/ipv6/ip6_fib.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index be36f4acda94..667b1b1ea25d 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -610,7 +610,7 @@ insert_above:
610 */ 610 */
611 611
612static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, 612static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
613 struct nlmsghdr *nlh, struct netlink_skb_parms *req) 613 struct nl_info *info)
614{ 614{
615 struct rt6_info *iter = NULL; 615 struct rt6_info *iter = NULL;
616 struct rt6_info **ins; 616 struct rt6_info **ins;
@@ -665,7 +665,7 @@ out:
665 *ins = rt; 665 *ins = rt;
666 rt->rt6i_node = fn; 666 rt->rt6i_node = fn;
667 atomic_inc(&rt->rt6i_ref); 667 atomic_inc(&rt->rt6i_ref);
668 inet6_rt_notify(RTM_NEWROUTE, rt, nlh, req); 668 inet6_rt_notify(RTM_NEWROUTE, rt, info);
669 rt6_stats.fib_rt_entries++; 669 rt6_stats.fib_rt_entries++;
670 670
671 if ((fn->fn_flags & RTN_RTINFO) == 0) { 671 if ((fn->fn_flags & RTN_RTINFO) == 0) {
@@ -695,8 +695,7 @@ void fib6_force_start_gc(void)
695 * with source addr info in sub-trees 695 * with source addr info in sub-trees
696 */ 696 */
697 697
698int fib6_add(struct fib6_node *root, struct rt6_info *rt, 698int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
699 struct nlmsghdr *nlh, void *_rtattr, struct netlink_skb_parms *req)
700{ 699{
701 struct fib6_node *fn; 700 struct fib6_node *fn;
702 int err = -ENOMEM; 701 int err = -ENOMEM;
@@ -769,7 +768,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
769 } 768 }
770#endif 769#endif
771 770
772 err = fib6_add_rt2node(fn, rt, nlh, req); 771 err = fib6_add_rt2node(fn, rt, info);
773 772
774 if (err == 0) { 773 if (err == 0) {
775 fib6_start_gc(rt); 774 fib6_start_gc(rt);
@@ -1076,7 +1075,7 @@ static struct fib6_node * fib6_repair_tree(struct fib6_node *fn)
1076} 1075}
1077 1076
1078static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp, 1077static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
1079 struct nlmsghdr *nlh, void *_rtattr, struct netlink_skb_parms *req) 1078 struct nl_info *info)
1080{ 1079{
1081 struct fib6_walker_t *w; 1080 struct fib6_walker_t *w;
1082 struct rt6_info *rt = *rtp; 1081 struct rt6_info *rt = *rtp;
@@ -1132,11 +1131,11 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
1132 if (atomic_read(&rt->rt6i_ref) != 1) BUG(); 1131 if (atomic_read(&rt->rt6i_ref) != 1) BUG();
1133 } 1132 }
1134 1133
1135 inet6_rt_notify(RTM_DELROUTE, rt, nlh, req); 1134 inet6_rt_notify(RTM_DELROUTE, rt, info);
1136 rt6_release(rt); 1135 rt6_release(rt);
1137} 1136}
1138 1137
1139int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr, struct netlink_skb_parms *req) 1138int fib6_del(struct rt6_info *rt, struct nl_info *info)
1140{ 1139{
1141 struct fib6_node *fn = rt->rt6i_node; 1140 struct fib6_node *fn = rt->rt6i_node;
1142 struct rt6_info **rtp; 1141 struct rt6_info **rtp;
@@ -1161,7 +1160,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr, struct ne
1161 1160
1162 for (rtp = &fn->leaf; *rtp; rtp = &(*rtp)->u.next) { 1161 for (rtp = &fn->leaf; *rtp; rtp = &(*rtp)->u.next) {
1163 if (*rtp == rt) { 1162 if (*rtp == rt) {
1164 fib6_del_route(fn, rtp, nlh, _rtattr, req); 1163 fib6_del_route(fn, rtp, info);
1165 return 0; 1164 return 0;
1166 } 1165 }
1167 } 1166 }
@@ -1290,7 +1289,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
1290 res = c->func(rt, c->arg); 1289 res = c->func(rt, c->arg);
1291 if (res < 0) { 1290 if (res < 0) {
1292 w->leaf = rt; 1291 w->leaf = rt;
1293 res = fib6_del(rt, NULL, NULL, NULL); 1292 res = fib6_del(rt, NULL);
1294 if (res) { 1293 if (res) {
1295#if RT6_DEBUG >= 2 1294#if RT6_DEBUG >= 2
1296 printk(KERN_DEBUG "fib6_clean_node: del failed: rt=%p@%p err=%d\n", rt, rt->rt6i_node, res); 1295 printk(KERN_DEBUG "fib6_clean_node: del failed: rt=%p@%p err=%d\n", rt, rt->rt6i_node, res);