summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/addrconf.c24
-rw-r--r--net/ipv6/anycast.c8
-rw-r--r--net/ipv6/ip6_fib.c170
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/route.c272
5 files changed, 238 insertions, 238 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index a294e86a9b25..f38ea829c28b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1178,19 +1178,19 @@ check_cleanup_prefix_route(struct inet6_ifaddr *ifp, unsigned long *expires)
1178static void 1178static void
1179cleanup_prefix_route(struct inet6_ifaddr *ifp, unsigned long expires, bool del_rt) 1179cleanup_prefix_route(struct inet6_ifaddr *ifp, unsigned long expires, bool del_rt)
1180{ 1180{
1181 struct fib6_info *rt; 1181 struct fib6_info *f6i;
1182 1182
1183 rt = addrconf_get_prefix_route(&ifp->addr, 1183 f6i = addrconf_get_prefix_route(&ifp->addr,
1184 ifp->prefix_len, 1184 ifp->prefix_len,
1185 ifp->idev->dev, 1185 ifp->idev->dev,
1186 0, RTF_GATEWAY | RTF_DEFAULT); 1186 0, RTF_GATEWAY | RTF_DEFAULT);
1187 if (rt) { 1187 if (f6i) {
1188 if (del_rt) 1188 if (del_rt)
1189 ip6_del_rt(dev_net(ifp->idev->dev), rt); 1189 ip6_del_rt(dev_net(ifp->idev->dev), f6i);
1190 else { 1190 else {
1191 if (!(rt->rt6i_flags & RTF_EXPIRES)) 1191 if (!(f6i->fib6_flags & RTF_EXPIRES))
1192 fib6_set_expires(rt, expires); 1192 fib6_set_expires(f6i, expires);
1193 fib6_info_release(rt); 1193 fib6_info_release(f6i);
1194 } 1194 }
1195 } 1195 }
1196} 1196}
@@ -2370,9 +2370,9 @@ static struct fib6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
2370 for_each_fib6_node_rt_rcu(fn) { 2370 for_each_fib6_node_rt_rcu(fn) {
2371 if (rt->fib6_nh.nh_dev->ifindex != dev->ifindex) 2371 if (rt->fib6_nh.nh_dev->ifindex != dev->ifindex)
2372 continue; 2372 continue;
2373 if ((rt->rt6i_flags & flags) != flags) 2373 if ((rt->fib6_flags & flags) != flags)
2374 continue; 2374 continue;
2375 if ((rt->rt6i_flags & noflags) != 0) 2375 if ((rt->fib6_flags & noflags) != 0)
2376 continue; 2376 continue;
2377 fib6_info_hold(rt); 2377 fib6_info_hold(rt);
2378 break; 2378 break;
@@ -3341,11 +3341,11 @@ static int fixup_permanent_addr(struct net *net,
3341 struct inet6_dev *idev, 3341 struct inet6_dev *idev,
3342 struct inet6_ifaddr *ifp) 3342 struct inet6_ifaddr *ifp)
3343{ 3343{
3344 /* !rt6i_node means the host route was removed from the 3344 /* !fib6_node means the host route was removed from the
3345 * FIB, for example, if 'lo' device is taken down. In that 3345 * FIB, for example, if 'lo' device is taken down. In that
3346 * case regenerate the host route. 3346 * case regenerate the host route.
3347 */ 3347 */
3348 if (!ifp->rt || !ifp->rt->rt6i_node) { 3348 if (!ifp->rt || !ifp->rt->fib6_node) {
3349 struct fib6_info *rt, *prev; 3349 struct fib6_info *rt, *prev;
3350 3350
3351 rt = addrconf_dst_alloc(net, idev, &ifp->addr, false, 3351 rt = addrconf_dst_alloc(net, idev, &ifp->addr, false,
@@ -5612,7 +5612,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
5612 * our DAD process, so we don't need 5612 * our DAD process, so we don't need
5613 * to do it again 5613 * to do it again
5614 */ 5614 */
5615 if (!rcu_access_pointer(ifp->rt->rt6i_node)) 5615 if (!rcu_access_pointer(ifp->rt->fib6_node))
5616 ip6_ins_rt(net, ifp->rt); 5616 ip6_ins_rt(net, ifp->rt);
5617 if (ifp->idev->cnf.forwarding) 5617 if (ifp->idev->cnf.forwarding)
5618 addrconf_join_anycast(ifp); 5618 addrconf_join_anycast(ifp);
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 0e35657501a7..eed3bf63bd05 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -218,10 +218,10 @@ static void aca_put(struct ifacaddr6 *ac)
218 } 218 }
219} 219}
220 220
221static struct ifacaddr6 *aca_alloc(struct fib6_info *rt, 221static struct ifacaddr6 *aca_alloc(struct fib6_info *f6i,
222 const struct in6_addr *addr) 222 const struct in6_addr *addr)
223{ 223{
224 struct inet6_dev *idev = rt->rt6i_idev; 224 struct inet6_dev *idev = f6i->fib6_idev;
225 struct ifacaddr6 *aca; 225 struct ifacaddr6 *aca;
226 226
227 aca = kzalloc(sizeof(*aca), GFP_ATOMIC); 227 aca = kzalloc(sizeof(*aca), GFP_ATOMIC);
@@ -231,8 +231,8 @@ static struct ifacaddr6 *aca_alloc(struct fib6_info *rt,
231 aca->aca_addr = *addr; 231 aca->aca_addr = *addr;
232 in6_dev_hold(idev); 232 in6_dev_hold(idev);
233 aca->aca_idev = idev; 233 aca->aca_idev = idev;
234 fib6_info_hold(rt); 234 fib6_info_hold(f6i);
235 aca->aca_rt = rt; 235 aca->aca_rt = f6i;
236 aca->aca_users = 1; 236 aca->aca_users = 1;
237 /* aca_tstamp should be updated upon changes */ 237 /* aca_tstamp should be updated upon changes */
238 aca->aca_cstamp = aca->aca_tstamp = jiffies; 238 aca->aca_cstamp = aca->aca_tstamp = jiffies;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 2ab49b7cac22..353f0b3e7b0d 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -105,12 +105,12 @@ enum {
105 FIB6_NO_SERNUM_CHANGE = 0, 105 FIB6_NO_SERNUM_CHANGE = 0,
106}; 106};
107 107
108void fib6_update_sernum(struct net *net, struct fib6_info *rt) 108void fib6_update_sernum(struct net *net, struct fib6_info *f6i)
109{ 109{
110 struct fib6_node *fn; 110 struct fib6_node *fn;
111 111
112 fn = rcu_dereference_protected(rt->rt6i_node, 112 fn = rcu_dereference_protected(f6i->fib6_node,
113 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 113 lockdep_is_held(&f6i->fib6_table->tb6_lock));
114 if (fn) 114 if (fn)
115 fn->fn_sernum = fib6_new_sernum(net); 115 fn->fn_sernum = fib6_new_sernum(net);
116} 116}
@@ -159,10 +159,10 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags)
159 return NULL; 159 return NULL;
160 } 160 }
161 161
162 INIT_LIST_HEAD(&f6i->rt6i_siblings); 162 INIT_LIST_HEAD(&f6i->fib6_siblings);
163 f6i->fib6_metrics = (struct dst_metrics *)&dst_default_metrics; 163 f6i->fib6_metrics = (struct dst_metrics *)&dst_default_metrics;
164 164
165 atomic_inc(&f6i->rt6i_ref); 165 atomic_inc(&f6i->fib6_ref);
166 166
167 return f6i; 167 return f6i;
168} 168}
@@ -172,7 +172,7 @@ void fib6_info_destroy(struct fib6_info *f6i)
172 struct rt6_exception_bucket *bucket; 172 struct rt6_exception_bucket *bucket;
173 struct dst_metrics *m; 173 struct dst_metrics *m;
174 174
175 WARN_ON(f6i->rt6i_node); 175 WARN_ON(f6i->fib6_node);
176 176
177 bucket = rcu_dereference_protected(f6i->rt6i_exception_bucket, 1); 177 bucket = rcu_dereference_protected(f6i->rt6i_exception_bucket, 1);
178 if (bucket) { 178 if (bucket) {
@@ -197,8 +197,8 @@ void fib6_info_destroy(struct fib6_info *f6i)
197 } 197 }
198 } 198 }
199 199
200 if (f6i->rt6i_idev) 200 if (f6i->fib6_idev)
201 in6_dev_put(f6i->rt6i_idev); 201 in6_dev_put(f6i->fib6_idev);
202 if (f6i->fib6_nh.nh_dev) 202 if (f6i->fib6_nh.nh_dev)
203 dev_put(f6i->fib6_nh.nh_dev); 203 dev_put(f6i->fib6_nh.nh_dev);
204 204
@@ -401,7 +401,7 @@ static int call_fib6_entry_notifiers(struct net *net,
401 .rt = rt, 401 .rt = rt,
402 }; 402 };
403 403
404 rt->rt6i_table->fib_seq++; 404 rt->fib6_table->fib_seq++;
405 return call_fib6_notifiers(net, event_type, &info.info); 405 return call_fib6_notifiers(net, event_type, &info.info);
406} 406}
407 407
@@ -483,10 +483,10 @@ static int fib6_dump_node(struct fib6_walker *w)
483 * last sibling of this route (no need to dump the 483 * last sibling of this route (no need to dump the
484 * sibling routes again) 484 * sibling routes again)
485 */ 485 */
486 if (rt->rt6i_nsiblings) 486 if (rt->fib6_nsiblings)
487 rt = list_last_entry(&rt->rt6i_siblings, 487 rt = list_last_entry(&rt->fib6_siblings,
488 struct fib6_info, 488 struct fib6_info,
489 rt6i_siblings); 489 fib6_siblings);
490 } 490 }
491 w->leaf = NULL; 491 w->leaf = NULL;
492 return 0; 492 return 0;
@@ -810,7 +810,7 @@ insert_above:
810 RCU_INIT_POINTER(in->parent, pn); 810 RCU_INIT_POINTER(in->parent, pn);
811 in->leaf = fn->leaf; 811 in->leaf = fn->leaf;
812 atomic_inc(&rcu_dereference_protected(in->leaf, 812 atomic_inc(&rcu_dereference_protected(in->leaf,
813 lockdep_is_held(&table->tb6_lock))->rt6i_ref); 813 lockdep_is_held(&table->tb6_lock))->fib6_ref);
814 814
815 /* update parent pointer */ 815 /* update parent pointer */
816 if (dir) 816 if (dir)
@@ -865,9 +865,9 @@ insert_above:
865static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn, 865static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn,
866 struct net *net) 866 struct net *net)
867{ 867{
868 struct fib6_table *table = rt->rt6i_table; 868 struct fib6_table *table = rt->fib6_table;
869 869
870 if (atomic_read(&rt->rt6i_ref) != 1) { 870 if (atomic_read(&rt->fib6_ref) != 1) {
871 /* This route is used as dummy address holder in some split 871 /* This route is used as dummy address holder in some split
872 * nodes. It is not leaked, but it still holds other resources, 872 * nodes. It is not leaked, but it still holds other resources,
873 * which must be released in time. So, scan ascendant nodes 873 * which must be released in time. So, scan ascendant nodes
@@ -880,7 +880,7 @@ static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn,
880 struct fib6_info *new_leaf; 880 struct fib6_info *new_leaf;
881 if (!(fn->fn_flags & RTN_RTINFO) && leaf == rt) { 881 if (!(fn->fn_flags & RTN_RTINFO) && leaf == rt) {
882 new_leaf = fib6_find_prefix(net, table, fn); 882 new_leaf = fib6_find_prefix(net, table, fn);
883 atomic_inc(&new_leaf->rt6i_ref); 883 atomic_inc(&new_leaf->fib6_ref);
884 884
885 rcu_assign_pointer(fn->leaf, new_leaf); 885 rcu_assign_pointer(fn->leaf, new_leaf);
886 fib6_info_release(rt); 886 fib6_info_release(rt);
@@ -919,7 +919,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
919 struct netlink_ext_ack *extack) 919 struct netlink_ext_ack *extack)
920{ 920{
921 struct fib6_info *leaf = rcu_dereference_protected(fn->leaf, 921 struct fib6_info *leaf = rcu_dereference_protected(fn->leaf,
922 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 922 lockdep_is_held(&rt->fib6_table->tb6_lock));
923 struct fib6_info *iter = NULL; 923 struct fib6_info *iter = NULL;
924 struct fib6_info __rcu **ins; 924 struct fib6_info __rcu **ins;
925 struct fib6_info __rcu **fallback_ins = NULL; 925 struct fib6_info __rcu **fallback_ins = NULL;
@@ -939,12 +939,12 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
939 939
940 for (iter = leaf; iter; 940 for (iter = leaf; iter;
941 iter = rcu_dereference_protected(iter->rt6_next, 941 iter = rcu_dereference_protected(iter->rt6_next,
942 lockdep_is_held(&rt->rt6i_table->tb6_lock))) { 942 lockdep_is_held(&rt->fib6_table->tb6_lock))) {
943 /* 943 /*
944 * Search for duplicates 944 * Search for duplicates
945 */ 945 */
946 946
947 if (iter->rt6i_metric == rt->rt6i_metric) { 947 if (iter->fib6_metric == rt->fib6_metric) {
948 /* 948 /*
949 * Same priority level 949 * Same priority level
950 */ 950 */
@@ -964,11 +964,11 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
964 } 964 }
965 965
966 if (rt6_duplicate_nexthop(iter, rt)) { 966 if (rt6_duplicate_nexthop(iter, rt)) {
967 if (rt->rt6i_nsiblings) 967 if (rt->fib6_nsiblings)
968 rt->rt6i_nsiblings = 0; 968 rt->fib6_nsiblings = 0;
969 if (!(iter->rt6i_flags & RTF_EXPIRES)) 969 if (!(iter->fib6_flags & RTF_EXPIRES))
970 return -EEXIST; 970 return -EEXIST;
971 if (!(rt->rt6i_flags & RTF_EXPIRES)) 971 if (!(rt->fib6_flags & RTF_EXPIRES))
972 fib6_clean_expires(iter); 972 fib6_clean_expires(iter);
973 else 973 else
974 fib6_set_expires(iter, rt->expires); 974 fib6_set_expires(iter, rt->expires);
@@ -988,10 +988,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
988 */ 988 */
989 if (rt_can_ecmp && 989 if (rt_can_ecmp &&
990 rt6_qualify_for_ecmp(iter)) 990 rt6_qualify_for_ecmp(iter))
991 rt->rt6i_nsiblings++; 991 rt->fib6_nsiblings++;
992 } 992 }
993 993
994 if (iter->rt6i_metric > rt->rt6i_metric) 994 if (iter->fib6_metric > rt->fib6_metric)
995 break; 995 break;
996 996
997next_iter: 997next_iter:
@@ -1002,7 +1002,7 @@ next_iter:
1002 /* No ECMP-able route found, replace first non-ECMP one */ 1002 /* No ECMP-able route found, replace first non-ECMP one */
1003 ins = fallback_ins; 1003 ins = fallback_ins;
1004 iter = rcu_dereference_protected(*ins, 1004 iter = rcu_dereference_protected(*ins,
1005 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1005 lockdep_is_held(&rt->fib6_table->tb6_lock));
1006 found++; 1006 found++;
1007 } 1007 }
1008 1008
@@ -1011,34 +1011,34 @@ next_iter:
1011 fn->rr_ptr = NULL; 1011 fn->rr_ptr = NULL;
1012 1012
1013 /* Link this route to others same route. */ 1013 /* Link this route to others same route. */
1014 if (rt->rt6i_nsiblings) { 1014 if (rt->fib6_nsiblings) {
1015 unsigned int rt6i_nsiblings; 1015 unsigned int fib6_nsiblings;
1016 struct fib6_info *sibling, *temp_sibling; 1016 struct fib6_info *sibling, *temp_sibling;
1017 1017
1018 /* Find the first route that have the same metric */ 1018 /* Find the first route that have the same metric */
1019 sibling = leaf; 1019 sibling = leaf;
1020 while (sibling) { 1020 while (sibling) {
1021 if (sibling->rt6i_metric == rt->rt6i_metric && 1021 if (sibling->fib6_metric == rt->fib6_metric &&
1022 rt6_qualify_for_ecmp(sibling)) { 1022 rt6_qualify_for_ecmp(sibling)) {
1023 list_add_tail(&rt->rt6i_siblings, 1023 list_add_tail(&rt->fib6_siblings,
1024 &sibling->rt6i_siblings); 1024 &sibling->fib6_siblings);
1025 break; 1025 break;
1026 } 1026 }
1027 sibling = rcu_dereference_protected(sibling->rt6_next, 1027 sibling = rcu_dereference_protected(sibling->rt6_next,
1028 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1028 lockdep_is_held(&rt->fib6_table->tb6_lock));
1029 } 1029 }
1030 /* For each sibling in the list, increment the counter of 1030 /* For each sibling in the list, increment the counter of
1031 * siblings. BUG() if counters does not match, list of siblings 1031 * siblings. BUG() if counters does not match, list of siblings
1032 * is broken! 1032 * is broken!
1033 */ 1033 */
1034 rt6i_nsiblings = 0; 1034 fib6_nsiblings = 0;
1035 list_for_each_entry_safe(sibling, temp_sibling, 1035 list_for_each_entry_safe(sibling, temp_sibling,
1036 &rt->rt6i_siblings, rt6i_siblings) { 1036 &rt->fib6_siblings, fib6_siblings) {
1037 sibling->rt6i_nsiblings++; 1037 sibling->fib6_nsiblings++;
1038 BUG_ON(sibling->rt6i_nsiblings != rt->rt6i_nsiblings); 1038 BUG_ON(sibling->fib6_nsiblings != rt->fib6_nsiblings);
1039 rt6i_nsiblings++; 1039 fib6_nsiblings++;
1040 } 1040 }
1041 BUG_ON(rt6i_nsiblings != rt->rt6i_nsiblings); 1041 BUG_ON(fib6_nsiblings != rt->fib6_nsiblings);
1042 rt6_multipath_rebalance(temp_sibling); 1042 rt6_multipath_rebalance(temp_sibling);
1043 } 1043 }
1044 1044
@@ -1059,8 +1059,8 @@ add:
1059 return err; 1059 return err;
1060 1060
1061 rcu_assign_pointer(rt->rt6_next, iter); 1061 rcu_assign_pointer(rt->rt6_next, iter);
1062 atomic_inc(&rt->rt6i_ref); 1062 atomic_inc(&rt->fib6_ref);
1063 rcu_assign_pointer(rt->rt6i_node, fn); 1063 rcu_assign_pointer(rt->fib6_node, fn);
1064 rcu_assign_pointer(*ins, rt); 1064 rcu_assign_pointer(*ins, rt);
1065 if (!info->skip_notify) 1065 if (!info->skip_notify)
1066 inet6_rt_notify(RTM_NEWROUTE, rt, info, nlflags); 1066 inet6_rt_notify(RTM_NEWROUTE, rt, info, nlflags);
@@ -1087,8 +1087,8 @@ add:
1087 if (err) 1087 if (err)
1088 return err; 1088 return err;
1089 1089
1090 atomic_inc(&rt->rt6i_ref); 1090 atomic_inc(&rt->fib6_ref);
1091 rcu_assign_pointer(rt->rt6i_node, fn); 1091 rcu_assign_pointer(rt->fib6_node, fn);
1092 rt->rt6_next = iter->rt6_next; 1092 rt->rt6_next = iter->rt6_next;
1093 rcu_assign_pointer(*ins, rt); 1093 rcu_assign_pointer(*ins, rt);
1094 if (!info->skip_notify) 1094 if (!info->skip_notify)
@@ -1097,8 +1097,8 @@ add:
1097 info->nl_net->ipv6.rt6_stats->fib_route_nodes++; 1097 info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
1098 fn->fn_flags |= RTN_RTINFO; 1098 fn->fn_flags |= RTN_RTINFO;
1099 } 1099 }
1100 nsiblings = iter->rt6i_nsiblings; 1100 nsiblings = iter->fib6_nsiblings;
1101 iter->rt6i_node = NULL; 1101 iter->fib6_node = NULL;
1102 fib6_purge_rt(iter, fn, info->nl_net); 1102 fib6_purge_rt(iter, fn, info->nl_net);
1103 if (rcu_access_pointer(fn->rr_ptr) == iter) 1103 if (rcu_access_pointer(fn->rr_ptr) == iter)
1104 fn->rr_ptr = NULL; 1104 fn->rr_ptr = NULL;
@@ -1108,13 +1108,13 @@ add:
1108 /* Replacing an ECMP route, remove all siblings */ 1108 /* Replacing an ECMP route, remove all siblings */
1109 ins = &rt->rt6_next; 1109 ins = &rt->rt6_next;
1110 iter = rcu_dereference_protected(*ins, 1110 iter = rcu_dereference_protected(*ins,
1111 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1111 lockdep_is_held(&rt->fib6_table->tb6_lock));
1112 while (iter) { 1112 while (iter) {
1113 if (iter->rt6i_metric > rt->rt6i_metric) 1113 if (iter->fib6_metric > rt->fib6_metric)
1114 break; 1114 break;
1115 if (rt6_qualify_for_ecmp(iter)) { 1115 if (rt6_qualify_for_ecmp(iter)) {
1116 *ins = iter->rt6_next; 1116 *ins = iter->rt6_next;
1117 iter->rt6i_node = NULL; 1117 iter->fib6_node = NULL;
1118 fib6_purge_rt(iter, fn, info->nl_net); 1118 fib6_purge_rt(iter, fn, info->nl_net);
1119 if (rcu_access_pointer(fn->rr_ptr) == iter) 1119 if (rcu_access_pointer(fn->rr_ptr) == iter)
1120 fn->rr_ptr = NULL; 1120 fn->rr_ptr = NULL;
@@ -1125,7 +1125,7 @@ add:
1125 ins = &iter->rt6_next; 1125 ins = &iter->rt6_next;
1126 } 1126 }
1127 iter = rcu_dereference_protected(*ins, 1127 iter = rcu_dereference_protected(*ins,
1128 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1128 lockdep_is_held(&rt->fib6_table->tb6_lock));
1129 } 1129 }
1130 WARN_ON(nsiblings != 0); 1130 WARN_ON(nsiblings != 0);
1131 } 1131 }
@@ -1137,7 +1137,7 @@ add:
1137static void fib6_start_gc(struct net *net, struct fib6_info *rt) 1137static void fib6_start_gc(struct net *net, struct fib6_info *rt)
1138{ 1138{
1139 if (!timer_pending(&net->ipv6.ip6_fib_timer) && 1139 if (!timer_pending(&net->ipv6.ip6_fib_timer) &&
1140 (rt->rt6i_flags & RTF_EXPIRES)) 1140 (rt->fib6_flags & RTF_EXPIRES))
1141 mod_timer(&net->ipv6.ip6_fib_timer, 1141 mod_timer(&net->ipv6.ip6_fib_timer,
1142 jiffies + net->ipv6.sysctl.ip6_rt_gc_interval); 1142 jiffies + net->ipv6.sysctl.ip6_rt_gc_interval);
1143} 1143}
@@ -1152,15 +1152,15 @@ void fib6_force_start_gc(struct net *net)
1152static void __fib6_update_sernum_upto_root(struct fib6_info *rt, 1152static void __fib6_update_sernum_upto_root(struct fib6_info *rt,
1153 int sernum) 1153 int sernum)
1154{ 1154{
1155 struct fib6_node *fn = rcu_dereference_protected(rt->rt6i_node, 1155 struct fib6_node *fn = rcu_dereference_protected(rt->fib6_node,
1156 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1156 lockdep_is_held(&rt->fib6_table->tb6_lock));
1157 1157
1158 /* paired with smp_rmb() in rt6_get_cookie_safe() */ 1158 /* paired with smp_rmb() in rt6_get_cookie_safe() */
1159 smp_wmb(); 1159 smp_wmb();
1160 while (fn) { 1160 while (fn) {
1161 fn->fn_sernum = sernum; 1161 fn->fn_sernum = sernum;
1162 fn = rcu_dereference_protected(fn->parent, 1162 fn = rcu_dereference_protected(fn->parent,
1163 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1163 lockdep_is_held(&rt->fib6_table->tb6_lock));
1164 } 1164 }
1165} 1165}
1166 1166
@@ -1179,7 +1179,7 @@ void fib6_update_sernum_upto_root(struct net *net, struct fib6_info *rt)
1179int fib6_add(struct fib6_node *root, struct fib6_info *rt, 1179int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1180 struct nl_info *info, struct netlink_ext_ack *extack) 1180 struct nl_info *info, struct netlink_ext_ack *extack)
1181{ 1181{
1182 struct fib6_table *table = rt->rt6i_table; 1182 struct fib6_table *table = rt->fib6_table;
1183 struct fib6_node *fn, *pn = NULL; 1183 struct fib6_node *fn, *pn = NULL;
1184 int err = -ENOMEM; 1184 int err = -ENOMEM;
1185 int allow_create = 1; 1185 int allow_create = 1;
@@ -1196,8 +1196,8 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1196 pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); 1196 pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n");
1197 1197
1198 fn = fib6_add_1(info->nl_net, table, root, 1198 fn = fib6_add_1(info->nl_net, table, root,
1199 &rt->rt6i_dst.addr, rt->rt6i_dst.plen, 1199 &rt->fib6_dst.addr, rt->fib6_dst.plen,
1200 offsetof(struct fib6_info, rt6i_dst), allow_create, 1200 offsetof(struct fib6_info, fib6_dst), allow_create,
1201 replace_required, extack); 1201 replace_required, extack);
1202 if (IS_ERR(fn)) { 1202 if (IS_ERR(fn)) {
1203 err = PTR_ERR(fn); 1203 err = PTR_ERR(fn);
@@ -1208,7 +1208,7 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1208 pn = fn; 1208 pn = fn;
1209 1209
1210#ifdef CONFIG_IPV6_SUBTREES 1210#ifdef CONFIG_IPV6_SUBTREES
1211 if (rt->rt6i_src.plen) { 1211 if (rt->fib6_src.plen) {
1212 struct fib6_node *sn; 1212 struct fib6_node *sn;
1213 1213
1214 if (!rcu_access_pointer(fn->subtree)) { 1214 if (!rcu_access_pointer(fn->subtree)) {
@@ -1229,7 +1229,7 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1229 if (!sfn) 1229 if (!sfn)
1230 goto failure; 1230 goto failure;
1231 1231
1232 atomic_inc(&info->nl_net->ipv6.fib6_null_entry->rt6i_ref); 1232 atomic_inc(&info->nl_net->ipv6.fib6_null_entry->fib6_ref);
1233 rcu_assign_pointer(sfn->leaf, 1233 rcu_assign_pointer(sfn->leaf,
1234 info->nl_net->ipv6.fib6_null_entry); 1234 info->nl_net->ipv6.fib6_null_entry);
1235 sfn->fn_flags = RTN_ROOT; 1235 sfn->fn_flags = RTN_ROOT;
@@ -1237,8 +1237,8 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1237 /* Now add the first leaf node to new subtree */ 1237 /* Now add the first leaf node to new subtree */
1238 1238
1239 sn = fib6_add_1(info->nl_net, table, sfn, 1239 sn = fib6_add_1(info->nl_net, table, sfn,
1240 &rt->rt6i_src.addr, rt->rt6i_src.plen, 1240 &rt->fib6_src.addr, rt->fib6_src.plen,
1241 offsetof(struct fib6_info, rt6i_src), 1241 offsetof(struct fib6_info, fib6_src),
1242 allow_create, replace_required, extack); 1242 allow_create, replace_required, extack);
1243 1243
1244 if (IS_ERR(sn)) { 1244 if (IS_ERR(sn)) {
@@ -1256,8 +1256,8 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1256 rcu_assign_pointer(fn->subtree, sfn); 1256 rcu_assign_pointer(fn->subtree, sfn);
1257 } else { 1257 } else {
1258 sn = fib6_add_1(info->nl_net, table, FIB6_SUBTREE(fn), 1258 sn = fib6_add_1(info->nl_net, table, FIB6_SUBTREE(fn),
1259 &rt->rt6i_src.addr, rt->rt6i_src.plen, 1259 &rt->fib6_src.addr, rt->fib6_src.plen,
1260 offsetof(struct fib6_info, rt6i_src), 1260 offsetof(struct fib6_info, fib6_src),
1261 allow_create, replace_required, extack); 1261 allow_create, replace_required, extack);
1262 1262
1263 if (IS_ERR(sn)) { 1263 if (IS_ERR(sn)) {
@@ -1272,7 +1272,7 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
1272 rcu_assign_pointer(fn->leaf, 1272 rcu_assign_pointer(fn->leaf,
1273 info->nl_net->ipv6.fib6_null_entry); 1273 info->nl_net->ipv6.fib6_null_entry);
1274 } else { 1274 } else {
1275 atomic_inc(&rt->rt6i_ref); 1275 atomic_inc(&rt->fib6_ref);
1276 rcu_assign_pointer(fn->leaf, rt); 1276 rcu_assign_pointer(fn->leaf, rt);
1277 } 1277 }
1278 } 1278 }
@@ -1421,12 +1421,12 @@ struct fib6_node *fib6_lookup(struct fib6_node *root, const struct in6_addr *dad
1421 struct fib6_node *fn; 1421 struct fib6_node *fn;
1422 struct lookup_args args[] = { 1422 struct lookup_args args[] = {
1423 { 1423 {
1424 .offset = offsetof(struct fib6_info, rt6i_dst), 1424 .offset = offsetof(struct fib6_info, fib6_dst),
1425 .addr = daddr, 1425 .addr = daddr,
1426 }, 1426 },
1427#ifdef CONFIG_IPV6_SUBTREES 1427#ifdef CONFIG_IPV6_SUBTREES
1428 { 1428 {
1429 .offset = offsetof(struct fib6_info, rt6i_src), 1429 .offset = offsetof(struct fib6_info, fib6_src),
1430 .addr = saddr, 1430 .addr = saddr,
1431 }, 1431 },
1432#endif 1432#endif
@@ -1511,7 +1511,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
1511 struct fib6_node *fn; 1511 struct fib6_node *fn;
1512 1512
1513 fn = fib6_locate_1(root, daddr, dst_len, 1513 fn = fib6_locate_1(root, daddr, dst_len,
1514 offsetof(struct fib6_info, rt6i_dst), 1514 offsetof(struct fib6_info, fib6_dst),
1515 exact_match); 1515 exact_match);
1516 1516
1517#ifdef CONFIG_IPV6_SUBTREES 1517#ifdef CONFIG_IPV6_SUBTREES
@@ -1522,7 +1522,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
1522 1522
1523 if (subtree) { 1523 if (subtree) {
1524 fn = fib6_locate_1(subtree, saddr, src_len, 1524 fn = fib6_locate_1(subtree, saddr, src_len,
1525 offsetof(struct fib6_info, rt6i_src), 1525 offsetof(struct fib6_info, fib6_src),
1526 exact_match); 1526 exact_match);
1527 } 1527 }
1528 } 1528 }
@@ -1706,7 +1706,7 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
1706 1706
1707 /* Unlink it */ 1707 /* Unlink it */
1708 *rtp = rt->rt6_next; 1708 *rtp = rt->rt6_next;
1709 rt->rt6i_node = NULL; 1709 rt->fib6_node = NULL;
1710 net->ipv6.rt6_stats->fib_rt_entries--; 1710 net->ipv6.rt6_stats->fib_rt_entries--;
1711 net->ipv6.rt6_stats->fib_discarded_routes++; 1711 net->ipv6.rt6_stats->fib_discarded_routes++;
1712 1712
@@ -1718,14 +1718,14 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
1718 fn->rr_ptr = NULL; 1718 fn->rr_ptr = NULL;
1719 1719
1720 /* Remove this entry from other siblings */ 1720 /* Remove this entry from other siblings */
1721 if (rt->rt6i_nsiblings) { 1721 if (rt->fib6_nsiblings) {
1722 struct fib6_info *sibling, *next_sibling; 1722 struct fib6_info *sibling, *next_sibling;
1723 1723
1724 list_for_each_entry_safe(sibling, next_sibling, 1724 list_for_each_entry_safe(sibling, next_sibling,
1725 &rt->rt6i_siblings, rt6i_siblings) 1725 &rt->fib6_siblings, fib6_siblings)
1726 sibling->rt6i_nsiblings--; 1726 sibling->fib6_nsiblings--;
1727 rt->rt6i_nsiblings = 0; 1727 rt->fib6_nsiblings = 0;
1728 list_del_init(&rt->rt6i_siblings); 1728 list_del_init(&rt->fib6_siblings);
1729 rt6_multipath_rebalance(next_sibling); 1729 rt6_multipath_rebalance(next_sibling);
1730 } 1730 }
1731 1731
@@ -1765,9 +1765,9 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
1765/* Need to own table->tb6_lock */ 1765/* Need to own table->tb6_lock */
1766int fib6_del(struct fib6_info *rt, struct nl_info *info) 1766int fib6_del(struct fib6_info *rt, struct nl_info *info)
1767{ 1767{
1768 struct fib6_node *fn = rcu_dereference_protected(rt->rt6i_node, 1768 struct fib6_node *fn = rcu_dereference_protected(rt->fib6_node,
1769 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 1769 lockdep_is_held(&rt->fib6_table->tb6_lock));
1770 struct fib6_table *table = rt->rt6i_table; 1770 struct fib6_table *table = rt->fib6_table;
1771 struct net *net = info->nl_net; 1771 struct net *net = info->nl_net;
1772 struct fib6_info __rcu **rtp; 1772 struct fib6_info __rcu **rtp;
1773 struct fib6_info __rcu **rtp_next; 1773 struct fib6_info __rcu **rtp_next;
@@ -1951,17 +1951,17 @@ static int fib6_clean_node(struct fib6_walker *w)
1951#if RT6_DEBUG >= 2 1951#if RT6_DEBUG >= 2
1952 pr_debug("%s: del failed: rt=%p@%p err=%d\n", 1952 pr_debug("%s: del failed: rt=%p@%p err=%d\n",
1953 __func__, rt, 1953 __func__, rt,
1954 rcu_access_pointer(rt->rt6i_node), 1954 rcu_access_pointer(rt->fib6_node),
1955 res); 1955 res);
1956#endif 1956#endif
1957 continue; 1957 continue;
1958 } 1958 }
1959 return 0; 1959 return 0;
1960 } else if (res == -2) { 1960 } else if (res == -2) {
1961 if (WARN_ON(!rt->rt6i_nsiblings)) 1961 if (WARN_ON(!rt->fib6_nsiblings))
1962 continue; 1962 continue;
1963 rt = list_last_entry(&rt->rt6i_siblings, 1963 rt = list_last_entry(&rt->fib6_siblings,
1964 struct fib6_info, rt6i_siblings); 1964 struct fib6_info, fib6_siblings);
1965 continue; 1965 continue;
1966 } 1966 }
1967 WARN_ON(res != 0); 1967 WARN_ON(res != 0);
@@ -2045,7 +2045,7 @@ static int fib6_age(struct fib6_info *rt, void *arg)
2045 * Routes are expired even if they are in use. 2045 * Routes are expired even if they are in use.
2046 */ 2046 */
2047 2047
2048 if (rt->rt6i_flags & RTF_EXPIRES && rt->expires) { 2048 if (rt->fib6_flags & RTF_EXPIRES && rt->expires) {
2049 if (time_after(now, rt->expires)) { 2049 if (time_after(now, rt->expires)) {
2050 RT6_TRACE("expiring %p\n", rt); 2050 RT6_TRACE("expiring %p\n", rt);
2051 return -1; 2051 return -1;
@@ -2243,22 +2243,22 @@ static int ipv6_route_seq_show(struct seq_file *seq, void *v)
2243 struct ipv6_route_iter *iter = seq->private; 2243 struct ipv6_route_iter *iter = seq->private;
2244 const struct net_device *dev; 2244 const struct net_device *dev;
2245 2245
2246 seq_printf(seq, "%pi6 %02x ", &rt->rt6i_dst.addr, rt->rt6i_dst.plen); 2246 seq_printf(seq, "%pi6 %02x ", &rt->fib6_dst.addr, rt->fib6_dst.plen);
2247 2247
2248#ifdef CONFIG_IPV6_SUBTREES 2248#ifdef CONFIG_IPV6_SUBTREES
2249 seq_printf(seq, "%pi6 %02x ", &rt->rt6i_src.addr, rt->rt6i_src.plen); 2249 seq_printf(seq, "%pi6 %02x ", &rt->fib6_src.addr, rt->fib6_src.plen);
2250#else 2250#else
2251 seq_puts(seq, "00000000000000000000000000000000 00 "); 2251 seq_puts(seq, "00000000000000000000000000000000 00 ");
2252#endif 2252#endif
2253 if (rt->rt6i_flags & RTF_GATEWAY) 2253 if (rt->fib6_flags & RTF_GATEWAY)
2254 seq_printf(seq, "%pi6", &rt->fib6_nh.nh_gw); 2254 seq_printf(seq, "%pi6", &rt->fib6_nh.nh_gw);
2255 else 2255 else
2256 seq_puts(seq, "00000000000000000000000000000000"); 2256 seq_puts(seq, "00000000000000000000000000000000");
2257 2257
2258 dev = rt->fib6_nh.nh_dev; 2258 dev = rt->fib6_nh.nh_dev;
2259 seq_printf(seq, " %08x %08x %08x %08x %8s\n", 2259 seq_printf(seq, " %08x %08x %08x %08x %8s\n",
2260 rt->rt6i_metric, atomic_read(&rt->rt6i_ref), 0, 2260 rt->fib6_metric, atomic_read(&rt->fib6_ref), 0,
2261 rt->rt6i_flags, dev ? dev->name : ""); 2261 rt->fib6_flags, dev ? dev->name : "");
2262 iter->w.leaf = NULL; 2262 iter->w.leaf = NULL;
2263 return 0; 2263 return 0;
2264} 2264}
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 102645298692..9ac5366064e3 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1318,7 +1318,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1318 } 1318 }
1319 neigh->flags |= NTF_ROUTER; 1319 neigh->flags |= NTF_ROUTER;
1320 } else if (rt) { 1320 } else if (rt) {
1321 rt->rt6i_flags = (rt->rt6i_flags & ~RTF_PREF_MASK) | RTF_PREF(pref); 1321 rt->fib6_flags = (rt->fib6_flags & ~RTF_PREF_MASK) | RTF_PREF(pref);
1322 } 1322 }
1323 1323
1324 if (rt) 1324 if (rt)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f9c363327d62..e23ab0784e65 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -284,10 +284,10 @@ static const u32 ip6_template_metrics[RTAX_MAX] = {
284}; 284};
285 285
286static const struct fib6_info fib6_null_entry_template = { 286static const struct fib6_info fib6_null_entry_template = {
287 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), 287 .fib6_flags = (RTF_REJECT | RTF_NONEXTHOP),
288 .rt6i_protocol = RTPROT_KERNEL, 288 .fib6_protocol = RTPROT_KERNEL,
289 .rt6i_metric = ~(u32)0, 289 .fib6_metric = ~(u32)0,
290 .rt6i_ref = ATOMIC_INIT(1), 290 .fib6_ref = ATOMIC_INIT(1),
291 .fib6_type = RTN_UNREACHABLE, 291 .fib6_type = RTN_UNREACHABLE,
292 .fib6_metrics = (struct dst_metrics *)&dst_default_metrics, 292 .fib6_metrics = (struct dst_metrics *)&dst_default_metrics,
293}; 293};
@@ -429,8 +429,8 @@ static struct fib6_info *rt6_multipath_select(const struct net *net,
429 if (fl6->mp_hash <= atomic_read(&match->fib6_nh.nh_upper_bound)) 429 if (fl6->mp_hash <= atomic_read(&match->fib6_nh.nh_upper_bound))
430 return match; 430 return match;
431 431
432 list_for_each_entry_safe(sibling, next_sibling, &match->rt6i_siblings, 432 list_for_each_entry_safe(sibling, next_sibling, &match->fib6_siblings,
433 rt6i_siblings) { 433 fib6_siblings) {
434 int nh_upper_bound; 434 int nh_upper_bound;
435 435
436 nh_upper_bound = atomic_read(&sibling->fib6_nh.nh_upper_bound); 436 nh_upper_bound = atomic_read(&sibling->fib6_nh.nh_upper_bound);
@@ -472,12 +472,12 @@ static inline struct fib6_info *rt6_device_match(struct net *net,
472 if (dev->ifindex == oif) 472 if (dev->ifindex == oif)
473 return sprt; 473 return sprt;
474 if (dev->flags & IFF_LOOPBACK) { 474 if (dev->flags & IFF_LOOPBACK) {
475 if (!sprt->rt6i_idev || 475 if (!sprt->fib6_idev ||
476 sprt->rt6i_idev->dev->ifindex != oif) { 476 sprt->fib6_idev->dev->ifindex != oif) {
477 if (flags & RT6_LOOKUP_F_IFACE) 477 if (flags & RT6_LOOKUP_F_IFACE)
478 continue; 478 continue;
479 if (local && 479 if (local &&
480 local->rt6i_idev->dev->ifindex == oif) 480 local->fib6_idev->dev->ifindex == oif)
481 continue; 481 continue;
482 } 482 }
483 local = sprt; 483 local = sprt;
@@ -534,7 +534,7 @@ static void rt6_probe(struct fib6_info *rt)
534 * Router Reachability Probe MUST be rate-limited 534 * Router Reachability Probe MUST be rate-limited
535 * to no more than one per minute. 535 * to no more than one per minute.
536 */ 536 */
537 if (!rt || !(rt->rt6i_flags & RTF_GATEWAY)) 537 if (!rt || !(rt->fib6_flags & RTF_GATEWAY))
538 return; 538 return;
539 539
540 nh_gw = &rt->fib6_nh.nh_gw; 540 nh_gw = &rt->fib6_nh.nh_gw;
@@ -550,7 +550,7 @@ static void rt6_probe(struct fib6_info *rt)
550 if (!(neigh->nud_state & NUD_VALID) && 550 if (!(neigh->nud_state & NUD_VALID) &&
551 time_after(jiffies, 551 time_after(jiffies,
552 neigh->updated + 552 neigh->updated +
553 rt->rt6i_idev->cnf.rtr_probe_interval)) { 553 rt->fib6_idev->cnf.rtr_probe_interval)) {
554 work = kmalloc(sizeof(*work), GFP_ATOMIC); 554 work = kmalloc(sizeof(*work), GFP_ATOMIC);
555 if (work) 555 if (work)
556 __neigh_set_probe_once(neigh); 556 __neigh_set_probe_once(neigh);
@@ -587,7 +587,7 @@ static inline int rt6_check_dev(struct fib6_info *rt, int oif)
587 if (!oif || dev->ifindex == oif) 587 if (!oif || dev->ifindex == oif)
588 return 2; 588 return 2;
589 if ((dev->flags & IFF_LOOPBACK) && 589 if ((dev->flags & IFF_LOOPBACK) &&
590 rt->rt6i_idev && rt->rt6i_idev->dev->ifindex == oif) 590 rt->fib6_idev && rt->fib6_idev->dev->ifindex == oif)
591 return 1; 591 return 1;
592 return 0; 592 return 0;
593} 593}
@@ -597,8 +597,8 @@ static inline enum rt6_nud_state rt6_check_neigh(struct fib6_info *rt)
597 enum rt6_nud_state ret = RT6_NUD_FAIL_HARD; 597 enum rt6_nud_state ret = RT6_NUD_FAIL_HARD;
598 struct neighbour *neigh; 598 struct neighbour *neigh;
599 599
600 if (rt->rt6i_flags & RTF_NONEXTHOP || 600 if (rt->fib6_flags & RTF_NONEXTHOP ||
601 !(rt->rt6i_flags & RTF_GATEWAY)) 601 !(rt->fib6_flags & RTF_GATEWAY))
602 return RT6_NUD_SUCCEED; 602 return RT6_NUD_SUCCEED;
603 603
604 rcu_read_lock_bh(); 604 rcu_read_lock_bh();
@@ -632,7 +632,7 @@ static int rt6_score_route(struct fib6_info *rt, int oif, int strict)
632 if (!m && (strict & RT6_LOOKUP_F_IFACE)) 632 if (!m && (strict & RT6_LOOKUP_F_IFACE))
633 return RT6_NUD_FAIL_HARD; 633 return RT6_NUD_FAIL_HARD;
634#ifdef CONFIG_IPV6_ROUTER_PREF 634#ifdef CONFIG_IPV6_ROUTER_PREF
635 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 635 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->fib6_flags)) << 2;
636#endif 636#endif
637 if (strict & RT6_LOOKUP_F_REACHABLE) { 637 if (strict & RT6_LOOKUP_F_REACHABLE) {
638 int n = rt6_check_neigh(rt); 638 int n = rt6_check_neigh(rt);
@@ -648,7 +648,7 @@ static struct fib6_info *find_match(struct fib6_info *rt, int oif, int strict,
648{ 648{
649 int m; 649 int m;
650 bool match_do_rr = false; 650 bool match_do_rr = false;
651 struct inet6_dev *idev = rt->rt6i_idev; 651 struct inet6_dev *idev = rt->fib6_idev;
652 652
653 if (rt->fib6_nh.nh_flags & RTNH_F_DEAD) 653 if (rt->fib6_nh.nh_flags & RTNH_F_DEAD)
654 goto out; 654 goto out;
@@ -694,7 +694,7 @@ static struct fib6_info *find_rr_leaf(struct fib6_node *fn,
694 match = NULL; 694 match = NULL;
695 cont = NULL; 695 cont = NULL;
696 for (rt = rr_head; rt; rt = rcu_dereference(rt->rt6_next)) { 696 for (rt = rr_head; rt; rt = rcu_dereference(rt->rt6_next)) {
697 if (rt->rt6i_metric != metric) { 697 if (rt->fib6_metric != metric) {
698 cont = rt; 698 cont = rt;
699 break; 699 break;
700 } 700 }
@@ -704,7 +704,7 @@ static struct fib6_info *find_rr_leaf(struct fib6_node *fn,
704 704
705 for (rt = leaf; rt && rt != rr_head; 705 for (rt = leaf; rt && rt != rr_head;
706 rt = rcu_dereference(rt->rt6_next)) { 706 rt = rcu_dereference(rt->rt6_next)) {
707 if (rt->rt6i_metric != metric) { 707 if (rt->fib6_metric != metric) {
708 cont = rt; 708 cont = rt;
709 break; 709 break;
710 } 710 }
@@ -741,30 +741,30 @@ static struct fib6_info *rt6_select(struct net *net, struct fib6_node *fn,
741 * (This might happen if all routes under fn are deleted from 741 * (This might happen if all routes under fn are deleted from
742 * the tree and fib6_repair_tree() is called on the node.) 742 * the tree and fib6_repair_tree() is called on the node.)
743 */ 743 */
744 key_plen = rt0->rt6i_dst.plen; 744 key_plen = rt0->fib6_dst.plen;
745#ifdef CONFIG_IPV6_SUBTREES 745#ifdef CONFIG_IPV6_SUBTREES
746 if (rt0->rt6i_src.plen) 746 if (rt0->fib6_src.plen)
747 key_plen = rt0->rt6i_src.plen; 747 key_plen = rt0->fib6_src.plen;
748#endif 748#endif
749 if (fn->fn_bit != key_plen) 749 if (fn->fn_bit != key_plen)
750 return net->ipv6.fib6_null_entry; 750 return net->ipv6.fib6_null_entry;
751 751
752 match = find_rr_leaf(fn, leaf, rt0, rt0->rt6i_metric, oif, strict, 752 match = find_rr_leaf(fn, leaf, rt0, rt0->fib6_metric, oif, strict,
753 &do_rr); 753 &do_rr);
754 754
755 if (do_rr) { 755 if (do_rr) {
756 struct fib6_info *next = rcu_dereference(rt0->rt6_next); 756 struct fib6_info *next = rcu_dereference(rt0->rt6_next);
757 757
758 /* no entries matched; do round-robin */ 758 /* no entries matched; do round-robin */
759 if (!next || next->rt6i_metric != rt0->rt6i_metric) 759 if (!next || next->fib6_metric != rt0->fib6_metric)
760 next = leaf; 760 next = leaf;
761 761
762 if (next != rt0) { 762 if (next != rt0) {
763 spin_lock_bh(&leaf->rt6i_table->tb6_lock); 763 spin_lock_bh(&leaf->fib6_table->tb6_lock);
764 /* make sure next is not being deleted from the tree */ 764 /* make sure next is not being deleted from the tree */
765 if (next->rt6i_node) 765 if (next->fib6_node)
766 rcu_assign_pointer(fn->rr_ptr, next); 766 rcu_assign_pointer(fn->rr_ptr, next);
767 spin_unlock_bh(&leaf->rt6i_table->tb6_lock); 767 spin_unlock_bh(&leaf->fib6_table->tb6_lock);
768 } 768 }
769 } 769 }
770 770
@@ -773,7 +773,7 @@ static struct fib6_info *rt6_select(struct net *net, struct fib6_node *fn,
773 773
774static bool rt6_is_gw_or_nonexthop(const struct fib6_info *rt) 774static bool rt6_is_gw_or_nonexthop(const struct fib6_info *rt)
775{ 775{
776 return (rt->rt6i_flags & (RTF_NONEXTHOP | RTF_GATEWAY)); 776 return (rt->fib6_flags & (RTF_NONEXTHOP | RTF_GATEWAY));
777} 777}
778 778
779#ifdef CONFIG_IPV6_ROUTE_INFO 779#ifdef CONFIG_IPV6_ROUTE_INFO
@@ -837,8 +837,8 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
837 rt = rt6_add_route_info(net, prefix, rinfo->prefix_len, gwaddr, 837 rt = rt6_add_route_info(net, prefix, rinfo->prefix_len, gwaddr,
838 dev, pref); 838 dev, pref);
839 else if (rt) 839 else if (rt)
840 rt->rt6i_flags = RTF_ROUTEINFO | 840 rt->fib6_flags = RTF_ROUTEINFO |
841 (rt->rt6i_flags & ~RTF_PREF_MASK) | RTF_PREF(pref); 841 (rt->fib6_flags & ~RTF_PREF_MASK) | RTF_PREF(pref);
842 842
843 if (rt) { 843 if (rt) {
844 if (!addrconf_finite_timeout(lifetime)) 844 if (!addrconf_finite_timeout(lifetime))
@@ -861,13 +861,13 @@ static struct net_device *ip6_rt_get_dev_rcu(struct fib6_info *rt)
861{ 861{
862 struct net_device *dev = rt->fib6_nh.nh_dev; 862 struct net_device *dev = rt->fib6_nh.nh_dev;
863 863
864 if (rt->rt6i_flags & (RTF_LOCAL | RTF_ANYCAST)) { 864 if (rt->fib6_flags & (RTF_LOCAL | RTF_ANYCAST)) {
865 /* for copies of local routes, dst->dev needs to be the 865 /* for copies of local routes, dst->dev needs to be the
866 * device if it is a master device, the master device if 866 * device if it is a master device, the master device if
867 * device is enslaved, and the loopback as the default 867 * device is enslaved, and the loopback as the default
868 */ 868 */
869 if (netif_is_l3_slave(dev) && 869 if (netif_is_l3_slave(dev) &&
870 !rt6_need_strict(&rt->rt6i_dst.addr)) 870 !rt6_need_strict(&rt->fib6_dst.addr))
871 dev = l3mdev_master_dev_rcu(dev); 871 dev = l3mdev_master_dev_rcu(dev);
872 else if (!netif_is_l3_master(dev)) 872 else if (!netif_is_l3_master(dev))
873 dev = dev_net(dev)->loopback_dev; 873 dev = dev_net(dev)->loopback_dev;
@@ -939,7 +939,7 @@ static void ip6_rt_init_dst(struct rt6_info *rt, struct fib6_info *ort)
939{ 939{
940 rt->dst.flags |= fib6_info_dst_flags(ort); 940 rt->dst.flags |= fib6_info_dst_flags(ort);
941 941
942 if (ort->rt6i_flags & RTF_REJECT) { 942 if (ort->fib6_flags & RTF_REJECT) {
943 ip6_rt_init_dst_reject(rt, ort); 943 ip6_rt_init_dst_reject(rt, ort);
944 return; 944 return;
945 } 945 }
@@ -949,7 +949,7 @@ static void ip6_rt_init_dst(struct rt6_info *rt, struct fib6_info *ort)
949 949
950 if (ort->fib6_type == RTN_LOCAL) { 950 if (ort->fib6_type == RTN_LOCAL) {
951 rt->dst.input = ip6_input; 951 rt->dst.input = ip6_input;
952 } else if (ipv6_addr_type(&ort->rt6i_dst.addr) & IPV6_ADDR_MULTICAST) { 952 } else if (ipv6_addr_type(&ort->fib6_dst.addr) & IPV6_ADDR_MULTICAST) {
953 rt->dst.input = ip6_mc_input; 953 rt->dst.input = ip6_mc_input;
954 } else { 954 } else {
955 rt->dst.input = ip6_forward; 955 rt->dst.input = ip6_forward;
@@ -979,17 +979,17 @@ static void ip6_rt_copy_init(struct rt6_info *rt, struct fib6_info *ort)
979{ 979{
980 ip6_rt_init_dst(rt, ort); 980 ip6_rt_init_dst(rt, ort);
981 981
982 rt->rt6i_dst = ort->rt6i_dst; 982 rt->rt6i_dst = ort->fib6_dst;
983 rt->rt6i_idev = ort->rt6i_idev; 983 rt->rt6i_idev = ort->fib6_idev;
984 if (rt->rt6i_idev) 984 if (rt->rt6i_idev)
985 in6_dev_hold(rt->rt6i_idev); 985 in6_dev_hold(rt->rt6i_idev);
986 rt->rt6i_gateway = ort->fib6_nh.nh_gw; 986 rt->rt6i_gateway = ort->fib6_nh.nh_gw;
987 rt->rt6i_flags = ort->rt6i_flags; 987 rt->rt6i_flags = ort->fib6_flags;
988 rt6_set_from(rt, ort); 988 rt6_set_from(rt, ort);
989#ifdef CONFIG_IPV6_SUBTREES 989#ifdef CONFIG_IPV6_SUBTREES
990 rt->rt6i_src = ort->rt6i_src; 990 rt->rt6i_src = ort->fib6_src;
991#endif 991#endif
992 rt->rt6i_prefsrc = ort->rt6i_prefsrc; 992 rt->rt6i_prefsrc = ort->fib6_prefsrc;
993 rt->dst.lwtstate = lwtstate_get(ort->fib6_nh.nh_lwtstate); 993 rt->dst.lwtstate = lwtstate_get(ort->fib6_nh.nh_lwtstate);
994} 994}
995 995
@@ -1064,7 +1064,7 @@ restart:
1064 } else { 1064 } else {
1065 f6i = rt6_device_match(net, f6i, &fl6->saddr, 1065 f6i = rt6_device_match(net, f6i, &fl6->saddr,
1066 fl6->flowi6_oif, flags); 1066 fl6->flowi6_oif, flags);
1067 if (f6i->rt6i_nsiblings && fl6->flowi6_oif == 0) 1067 if (f6i->fib6_nsiblings && fl6->flowi6_oif == 0)
1068 f6i = rt6_multipath_select(net, f6i, fl6, 1068 f6i = rt6_multipath_select(net, f6i, fl6,
1069 fl6->flowi6_oif, skb, flags); 1069 fl6->flowi6_oif, skb, flags);
1070 } 1070 }
@@ -1142,7 +1142,7 @@ static int __ip6_ins_rt(struct fib6_info *rt, struct nl_info *info,
1142 int err; 1142 int err;
1143 struct fib6_table *table; 1143 struct fib6_table *table;
1144 1144
1145 table = rt->rt6i_table; 1145 table = rt->fib6_table;
1146 spin_lock_bh(&table->tb6_lock); 1146 spin_lock_bh(&table->tb6_lock);
1147 err = fib6_add(&table->tb6_root, rt, info, extack); 1147 err = fib6_add(&table->tb6_root, rt, info, extack);
1148 spin_unlock_bh(&table->tb6_lock); 1148 spin_unlock_bh(&table->tb6_lock);
@@ -1182,8 +1182,8 @@ static struct rt6_info *ip6_rt_cache_alloc(struct fib6_info *ort,
1182 rt->rt6i_dst.plen = 128; 1182 rt->rt6i_dst.plen = 128;
1183 1183
1184 if (!rt6_is_gw_or_nonexthop(ort)) { 1184 if (!rt6_is_gw_or_nonexthop(ort)) {
1185 if (ort->rt6i_dst.plen != 128 && 1185 if (ort->fib6_dst.plen != 128 &&
1186 ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) 1186 ipv6_addr_equal(&ort->fib6_dst.addr, daddr))
1187 rt->rt6i_flags |= RTF_ANYCAST; 1187 rt->rt6i_flags |= RTF_ANYCAST;
1188#ifdef CONFIG_IPV6_SUBTREES 1188#ifdef CONFIG_IPV6_SUBTREES
1189 if (rt->rt6i_src.plen && saddr) { 1189 if (rt->rt6i_src.plen && saddr) {
@@ -1375,7 +1375,7 @@ static unsigned int fib6_mtu(const struct fib6_info *rt)
1375{ 1375{
1376 unsigned int mtu; 1376 unsigned int mtu;
1377 1377
1378 mtu = rt->fib6_pmtu ? : rt->rt6i_idev->cnf.mtu6; 1378 mtu = rt->fib6_pmtu ? : rt->fib6_idev->cnf.mtu6;
1379 mtu = min_t(unsigned int, mtu, IP6_MAX_MTU); 1379 mtu = min_t(unsigned int, mtu, IP6_MAX_MTU);
1380 1380
1381 return mtu - lwtunnel_headroom(rt->fib6_nh.nh_lwtstate, mtu); 1381 return mtu - lwtunnel_headroom(rt->fib6_nh.nh_lwtstate, mtu);
@@ -1416,14 +1416,14 @@ static int rt6_insert_exception(struct rt6_info *nrt,
1416 * Otherwise, the exception table is indexed by 1416 * Otherwise, the exception table is indexed by
1417 * a hash of only rt6i_dst. 1417 * a hash of only rt6i_dst.
1418 */ 1418 */
1419 if (ort->rt6i_src.plen) 1419 if (ort->fib6_src.plen)
1420 src_key = &nrt->rt6i_src.addr; 1420 src_key = &nrt->rt6i_src.addr;
1421#endif 1421#endif
1422 1422
1423 /* Update rt6i_prefsrc as it could be changed 1423 /* Update rt6i_prefsrc as it could be changed
1424 * in rt6_remove_prefsrc() 1424 * in rt6_remove_prefsrc()
1425 */ 1425 */
1426 nrt->rt6i_prefsrc = ort->rt6i_prefsrc; 1426 nrt->rt6i_prefsrc = ort->fib6_prefsrc;
1427 /* rt6_mtu_change() might lower mtu on ort. 1427 /* rt6_mtu_change() might lower mtu on ort.
1428 * Only insert this exception route if its mtu 1428 * Only insert this exception route if its mtu
1429 * is less than ort's mtu value. 1429 * is less than ort's mtu value.
@@ -1457,9 +1457,9 @@ out:
1457 1457
1458 /* Update fn->fn_sernum to invalidate all cached dst */ 1458 /* Update fn->fn_sernum to invalidate all cached dst */
1459 if (!err) { 1459 if (!err) {
1460 spin_lock_bh(&ort->rt6i_table->tb6_lock); 1460 spin_lock_bh(&ort->fib6_table->tb6_lock);
1461 fib6_update_sernum(net, ort); 1461 fib6_update_sernum(net, ort);
1462 spin_unlock_bh(&ort->rt6i_table->tb6_lock); 1462 spin_unlock_bh(&ort->fib6_table->tb6_lock);
1463 fib6_force_start_gc(net); 1463 fib6_force_start_gc(net);
1464 } 1464 }
1465 1465
@@ -1514,7 +1514,7 @@ static struct rt6_info *rt6_find_cached_rt(struct fib6_info *rt,
1514 * Otherwise, the exception table is indexed by 1514 * Otherwise, the exception table is indexed by
1515 * a hash of only rt6i_dst. 1515 * a hash of only rt6i_dst.
1516 */ 1516 */
1517 if (rt->rt6i_src.plen) 1517 if (rt->fib6_src.plen)
1518 src_key = saddr; 1518 src_key = saddr;
1519#endif 1519#endif
1520 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key); 1520 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key);
@@ -1551,7 +1551,7 @@ static int rt6_remove_exception_rt(struct rt6_info *rt)
1551 * Otherwise, the exception table is indexed by 1551 * Otherwise, the exception table is indexed by
1552 * a hash of only rt6i_dst. 1552 * a hash of only rt6i_dst.
1553 */ 1553 */
1554 if (from->rt6i_src.plen) 1554 if (from->fib6_src.plen)
1555 src_key = &rt->rt6i_src.addr; 1555 src_key = &rt->rt6i_src.addr;
1556#endif 1556#endif
1557 rt6_ex = __rt6_find_exception_spinlock(&bucket, 1557 rt6_ex = __rt6_find_exception_spinlock(&bucket,
@@ -1592,7 +1592,7 @@ static void rt6_update_exception_stamp_rt(struct rt6_info *rt)
1592 * Otherwise, the exception table is indexed by 1592 * Otherwise, the exception table is indexed by
1593 * a hash of only rt6i_dst. 1593 * a hash of only rt6i_dst.
1594 */ 1594 */
1595 if (from->rt6i_src.plen) 1595 if (from->fib6_src.plen)
1596 src_key = &rt->rt6i_src.addr; 1596 src_key = &rt->rt6i_src.addr;
1597#endif 1597#endif
1598 rt6_ex = __rt6_find_exception_rcu(&bucket, 1598 rt6_ex = __rt6_find_exception_rcu(&bucket,
@@ -1810,7 +1810,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
1810 1810
1811redo_rt6_select: 1811redo_rt6_select:
1812 f6i = rt6_select(net, fn, oif, strict); 1812 f6i = rt6_select(net, fn, oif, strict);
1813 if (f6i->rt6i_nsiblings) 1813 if (f6i->fib6_nsiblings)
1814 f6i = rt6_multipath_select(net, f6i, fl6, oif, skb, strict); 1814 f6i = rt6_multipath_select(net, f6i, fl6, oif, skb, strict);
1815 if (f6i == net->ipv6.fib6_null_entry) { 1815 if (f6i == net->ipv6.fib6_null_entry) {
1816 fn = fib6_backtrack(fn, &fl6->saddr); 1816 fn = fib6_backtrack(fn, &fl6->saddr);
@@ -1842,7 +1842,7 @@ redo_rt6_select:
1842 trace_fib6_table_lookup(net, rt, table, fl6); 1842 trace_fib6_table_lookup(net, rt, table, fl6);
1843 return rt; 1843 return rt;
1844 } else if (unlikely((fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH) && 1844 } else if (unlikely((fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH) &&
1845 !(f6i->rt6i_flags & RTF_GATEWAY))) { 1845 !(f6i->fib6_flags & RTF_GATEWAY))) {
1846 /* Create a RTF_CACHE clone which will not be 1846 /* Create a RTF_CACHE clone which will not be
1847 * owned by the fib6 tree. It is for the special case where 1847 * owned by the fib6 tree. It is for the special case where
1848 * the daddr in the skb during the neighbor look-up is different 1848 * the daddr in the skb during the neighbor look-up is different
@@ -2206,7 +2206,7 @@ static void ip6_link_failure(struct sk_buff *skb)
2206 struct fib6_node *fn; 2206 struct fib6_node *fn;
2207 2207
2208 rcu_read_lock(); 2208 rcu_read_lock();
2209 fn = rcu_dereference(rt->from->rt6i_node); 2209 fn = rcu_dereference(rt->from->fib6_node);
2210 if (fn && (rt->rt6i_flags & RTF_DEFAULT)) 2210 if (fn && (rt->rt6i_flags & RTF_DEFAULT))
2211 fn->fn_sernum = -1; 2211 fn->fn_sernum = -1;
2212 rcu_read_unlock(); 2212 rcu_read_unlock();
@@ -2372,9 +2372,9 @@ restart:
2372 continue; 2372 continue;
2373 if (fib6_check_expired(rt)) 2373 if (fib6_check_expired(rt))
2374 continue; 2374 continue;
2375 if (rt->rt6i_flags & RTF_REJECT) 2375 if (rt->fib6_flags & RTF_REJECT)
2376 break; 2376 break;
2377 if (!(rt->rt6i_flags & RTF_GATEWAY)) 2377 if (!(rt->fib6_flags & RTF_GATEWAY))
2378 continue; 2378 continue;
2379 if (fl6->flowi6_oif != rt->fib6_nh.nh_dev->ifindex) 2379 if (fl6->flowi6_oif != rt->fib6_nh.nh_dev->ifindex)
2380 continue; 2380 continue;
@@ -2400,7 +2400,7 @@ restart:
2400 2400
2401 if (!rt) 2401 if (!rt)
2402 rt = net->ipv6.fib6_null_entry; 2402 rt = net->ipv6.fib6_null_entry;
2403 else if (rt->rt6i_flags & RTF_REJECT) { 2403 else if (rt->fib6_flags & RTF_REJECT) {
2404 ret = net->ipv6.ip6_null_entry; 2404 ret = net->ipv6.ip6_null_entry;
2405 goto out; 2405 goto out;
2406 } 2406 }
@@ -2907,7 +2907,7 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
2907 2907
2908 if (cfg->fc_protocol == RTPROT_UNSPEC) 2908 if (cfg->fc_protocol == RTPROT_UNSPEC)
2909 cfg->fc_protocol = RTPROT_BOOT; 2909 cfg->fc_protocol = RTPROT_BOOT;
2910 rt->rt6i_protocol = cfg->fc_protocol; 2910 rt->fib6_protocol = cfg->fc_protocol;
2911 2911
2912 addr_type = ipv6_addr_type(&cfg->fc_dst); 2912 addr_type = ipv6_addr_type(&cfg->fc_dst);
2913 2913
@@ -2922,17 +2922,17 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
2922 rt->fib6_nh.nh_lwtstate = lwtstate_get(lwtstate); 2922 rt->fib6_nh.nh_lwtstate = lwtstate_get(lwtstate);
2923 } 2923 }
2924 2924
2925 ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len); 2925 ipv6_addr_prefix(&rt->fib6_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);
2926 rt->rt6i_dst.plen = cfg->fc_dst_len; 2926 rt->fib6_dst.plen = cfg->fc_dst_len;
2927 if (rt->rt6i_dst.plen == 128) 2927 if (rt->fib6_dst.plen == 128)
2928 rt->dst_host = true; 2928 rt->dst_host = true;
2929 2929
2930#ifdef CONFIG_IPV6_SUBTREES 2930#ifdef CONFIG_IPV6_SUBTREES
2931 ipv6_addr_prefix(&rt->rt6i_src.addr, &cfg->fc_src, cfg->fc_src_len); 2931 ipv6_addr_prefix(&rt->fib6_src.addr, &cfg->fc_src, cfg->fc_src_len);
2932 rt->rt6i_src.plen = cfg->fc_src_len; 2932 rt->fib6_src.plen = cfg->fc_src_len;
2933#endif 2933#endif
2934 2934
2935 rt->rt6i_metric = cfg->fc_metric; 2935 rt->fib6_metric = cfg->fc_metric;
2936 rt->fib6_nh.nh_weight = 1; 2936 rt->fib6_nh.nh_weight = 1;
2937 2937
2938 rt->fib6_type = cfg->fc_type; 2938 rt->fib6_type = cfg->fc_type;
@@ -2958,7 +2958,7 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
2958 goto out; 2958 goto out;
2959 } 2959 }
2960 } 2960 }
2961 rt->rt6i_flags = RTF_REJECT|RTF_NONEXTHOP; 2961 rt->fib6_flags = RTF_REJECT|RTF_NONEXTHOP;
2962 goto install_route; 2962 goto install_route;
2963 } 2963 }
2964 2964
@@ -2992,21 +2992,21 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
2992 err = -EINVAL; 2992 err = -EINVAL;
2993 goto out; 2993 goto out;
2994 } 2994 }
2995 rt->rt6i_prefsrc.addr = cfg->fc_prefsrc; 2995 rt->fib6_prefsrc.addr = cfg->fc_prefsrc;
2996 rt->rt6i_prefsrc.plen = 128; 2996 rt->fib6_prefsrc.plen = 128;
2997 } else 2997 } else
2998 rt->rt6i_prefsrc.plen = 0; 2998 rt->fib6_prefsrc.plen = 0;
2999 2999
3000 rt->rt6i_flags = cfg->fc_flags; 3000 rt->fib6_flags = cfg->fc_flags;
3001 3001
3002install_route: 3002install_route:
3003 if (!(rt->rt6i_flags & (RTF_LOCAL | RTF_ANYCAST)) && 3003 if (!(rt->fib6_flags & (RTF_LOCAL | RTF_ANYCAST)) &&
3004 !netif_carrier_ok(dev)) 3004 !netif_carrier_ok(dev))
3005 rt->fib6_nh.nh_flags |= RTNH_F_LINKDOWN; 3005 rt->fib6_nh.nh_flags |= RTNH_F_LINKDOWN;
3006 rt->fib6_nh.nh_flags |= (cfg->fc_flags & RTNH_F_ONLINK); 3006 rt->fib6_nh.nh_flags |= (cfg->fc_flags & RTNH_F_ONLINK);
3007 rt->fib6_nh.nh_dev = dev; 3007 rt->fib6_nh.nh_dev = dev;
3008 rt->rt6i_idev = idev; 3008 rt->fib6_idev = idev;
3009 rt->rt6i_table = table; 3009 rt->fib6_table = table;
3010 3010
3011 cfg->fc_nlinfo.nl_net = dev_net(dev); 3011 cfg->fc_nlinfo.nl_net = dev_net(dev);
3012 3012
@@ -3048,7 +3048,7 @@ static int __ip6_del_rt(struct fib6_info *rt, struct nl_info *info)
3048 goto out; 3048 goto out;
3049 } 3049 }
3050 3050
3051 table = rt->rt6i_table; 3051 table = rt->fib6_table;
3052 spin_lock_bh(&table->tb6_lock); 3052 spin_lock_bh(&table->tb6_lock);
3053 err = fib6_del(rt, info); 3053 err = fib6_del(rt, info);
3054 spin_unlock_bh(&table->tb6_lock); 3054 spin_unlock_bh(&table->tb6_lock);
@@ -3075,10 +3075,10 @@ static int __ip6_del_rt_siblings(struct fib6_info *rt, struct fib6_config *cfg)
3075 3075
3076 if (rt == net->ipv6.fib6_null_entry) 3076 if (rt == net->ipv6.fib6_null_entry)
3077 goto out_put; 3077 goto out_put;
3078 table = rt->rt6i_table; 3078 table = rt->fib6_table;
3079 spin_lock_bh(&table->tb6_lock); 3079 spin_lock_bh(&table->tb6_lock);
3080 3080
3081 if (rt->rt6i_nsiblings && cfg->fc_delete_all_nh) { 3081 if (rt->fib6_nsiblings && cfg->fc_delete_all_nh) {
3082 struct fib6_info *sibling, *next_sibling; 3082 struct fib6_info *sibling, *next_sibling;
3083 3083
3084 /* prefer to send a single notification with all hops */ 3084 /* prefer to send a single notification with all hops */
@@ -3096,8 +3096,8 @@ static int __ip6_del_rt_siblings(struct fib6_info *rt, struct fib6_config *cfg)
3096 } 3096 }
3097 3097
3098 list_for_each_entry_safe(sibling, next_sibling, 3098 list_for_each_entry_safe(sibling, next_sibling,
3099 &rt->rt6i_siblings, 3099 &rt->fib6_siblings,
3100 rt6i_siblings) { 3100 fib6_siblings) {
3101 err = fib6_del(sibling, info); 3101 err = fib6_del(sibling, info);
3102 if (err) 3102 if (err)
3103 goto out_unlock; 3103 goto out_unlock;
@@ -3176,9 +3176,9 @@ static int ip6_route_del(struct fib6_config *cfg,
3176 if (cfg->fc_flags & RTF_GATEWAY && 3176 if (cfg->fc_flags & RTF_GATEWAY &&
3177 !ipv6_addr_equal(&cfg->fc_gateway, &rt->fib6_nh.nh_gw)) 3177 !ipv6_addr_equal(&cfg->fc_gateway, &rt->fib6_nh.nh_gw))
3178 continue; 3178 continue;
3179 if (cfg->fc_metric && cfg->fc_metric != rt->rt6i_metric) 3179 if (cfg->fc_metric && cfg->fc_metric != rt->fib6_metric)
3180 continue; 3180 continue;
3181 if (cfg->fc_protocol && cfg->fc_protocol != rt->rt6i_protocol) 3181 if (cfg->fc_protocol && cfg->fc_protocol != rt->fib6_protocol)
3182 continue; 3182 continue;
3183 fib6_info_hold(rt); 3183 fib6_info_hold(rt);
3184 rcu_read_unlock(); 3184 rcu_read_unlock();
@@ -3336,7 +3336,7 @@ static struct fib6_info *rt6_get_route_info(struct net *net,
3336 for_each_fib6_node_rt_rcu(fn) { 3336 for_each_fib6_node_rt_rcu(fn) {
3337 if (rt->fib6_nh.nh_dev->ifindex != ifindex) 3337 if (rt->fib6_nh.nh_dev->ifindex != ifindex)
3338 continue; 3338 continue;
3339 if ((rt->rt6i_flags & (RTF_ROUTEINFO|RTF_GATEWAY)) != (RTF_ROUTEINFO|RTF_GATEWAY)) 3339 if ((rt->fib6_flags & (RTF_ROUTEINFO|RTF_GATEWAY)) != (RTF_ROUTEINFO|RTF_GATEWAY))
3340 continue; 3340 continue;
3341 if (!ipv6_addr_equal(&rt->fib6_nh.nh_gw, gwaddr)) 3341 if (!ipv6_addr_equal(&rt->fib6_nh.nh_gw, gwaddr))
3342 continue; 3342 continue;
@@ -3396,7 +3396,7 @@ struct fib6_info *rt6_get_dflt_router(struct net *net,
3396 rcu_read_lock(); 3396 rcu_read_lock();
3397 for_each_fib6_node_rt_rcu(&table->tb6_root) { 3397 for_each_fib6_node_rt_rcu(&table->tb6_root) {
3398 if (dev == rt->fib6_nh.nh_dev && 3398 if (dev == rt->fib6_nh.nh_dev &&
3399 ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) && 3399 ((rt->fib6_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) &&
3400 ipv6_addr_equal(&rt->fib6_nh.nh_gw, addr)) 3400 ipv6_addr_equal(&rt->fib6_nh.nh_gw, addr))
3401 break; 3401 break;
3402 } 3402 }
@@ -3445,8 +3445,8 @@ static void __rt6_purge_dflt_routers(struct net *net,
3445restart: 3445restart:
3446 rcu_read_lock(); 3446 rcu_read_lock();
3447 for_each_fib6_node_rt_rcu(&table->tb6_root) { 3447 for_each_fib6_node_rt_rcu(&table->tb6_root) {
3448 if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF) && 3448 if (rt->fib6_flags & (RTF_DEFAULT | RTF_ADDRCONF) &&
3449 (!rt->rt6i_idev || rt->rt6i_idev->cnf.accept_ra != 2)) { 3449 (!rt->fib6_idev || rt->fib6_idev->cnf.accept_ra != 2)) {
3450 fib6_info_hold(rt); 3450 fib6_info_hold(rt);
3451 rcu_read_unlock(); 3451 rcu_read_unlock();
3452 ip6_del_rt(net, rt); 3452 ip6_del_rt(net, rt);
@@ -3607,26 +3607,26 @@ struct fib6_info *addrconf_dst_alloc(struct net *net,
3607 rt->dst_nocount = true; 3607 rt->dst_nocount = true;
3608 3608
3609 in6_dev_hold(idev); 3609 in6_dev_hold(idev);
3610 rt->rt6i_idev = idev; 3610 rt->fib6_idev = idev;
3611 3611
3612 rt->dst_host = true; 3612 rt->dst_host = true;
3613 rt->rt6i_protocol = RTPROT_KERNEL; 3613 rt->fib6_protocol = RTPROT_KERNEL;
3614 rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; 3614 rt->fib6_flags = RTF_UP | RTF_NONEXTHOP;
3615 if (anycast) { 3615 if (anycast) {
3616 rt->fib6_type = RTN_ANYCAST; 3616 rt->fib6_type = RTN_ANYCAST;
3617 rt->rt6i_flags |= RTF_ANYCAST; 3617 rt->fib6_flags |= RTF_ANYCAST;
3618 } else { 3618 } else {
3619 rt->fib6_type = RTN_LOCAL; 3619 rt->fib6_type = RTN_LOCAL;
3620 rt->rt6i_flags |= RTF_LOCAL; 3620 rt->fib6_flags |= RTF_LOCAL;
3621 } 3621 }
3622 3622
3623 rt->fib6_nh.nh_gw = *addr; 3623 rt->fib6_nh.nh_gw = *addr;
3624 dev_hold(dev); 3624 dev_hold(dev);
3625 rt->fib6_nh.nh_dev = dev; 3625 rt->fib6_nh.nh_dev = dev;
3626 rt->rt6i_dst.addr = *addr; 3626 rt->fib6_dst.addr = *addr;
3627 rt->rt6i_dst.plen = 128; 3627 rt->fib6_dst.plen = 128;
3628 tb_id = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL; 3628 tb_id = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL;
3629 rt->rt6i_table = fib6_get_table(net, tb_id); 3629 rt->fib6_table = fib6_get_table(net, tb_id);
3630 3630
3631 return rt; 3631 return rt;
3632} 3632}
@@ -3646,10 +3646,10 @@ static int fib6_remove_prefsrc(struct fib6_info *rt, void *arg)
3646 3646
3647 if (((void *)rt->fib6_nh.nh_dev == dev || !dev) && 3647 if (((void *)rt->fib6_nh.nh_dev == dev || !dev) &&
3648 rt != net->ipv6.fib6_null_entry && 3648 rt != net->ipv6.fib6_null_entry &&
3649 ipv6_addr_equal(addr, &rt->rt6i_prefsrc.addr)) { 3649 ipv6_addr_equal(addr, &rt->fib6_prefsrc.addr)) {
3650 spin_lock_bh(&rt6_exception_lock); 3650 spin_lock_bh(&rt6_exception_lock);
3651 /* remove prefsrc entry */ 3651 /* remove prefsrc entry */
3652 rt->rt6i_prefsrc.plen = 0; 3652 rt->fib6_prefsrc.plen = 0;
3653 /* need to update cache as well */ 3653 /* need to update cache as well */
3654 rt6_exceptions_remove_prefsrc(rt); 3654 rt6_exceptions_remove_prefsrc(rt);
3655 spin_unlock_bh(&rt6_exception_lock); 3655 spin_unlock_bh(&rt6_exception_lock);
@@ -3675,7 +3675,7 @@ static int fib6_clean_tohost(struct fib6_info *rt, void *arg)
3675{ 3675{
3676 struct in6_addr *gateway = (struct in6_addr *)arg; 3676 struct in6_addr *gateway = (struct in6_addr *)arg;
3677 3677
3678 if (((rt->rt6i_flags & RTF_RA_ROUTER) == RTF_RA_ROUTER) && 3678 if (((rt->fib6_flags & RTF_RA_ROUTER) == RTF_RA_ROUTER) &&
3679 ipv6_addr_equal(gateway, &rt->fib6_nh.nh_gw)) { 3679 ipv6_addr_equal(gateway, &rt->fib6_nh.nh_gw)) {
3680 return -1; 3680 return -1;
3681 } 3681 }
@@ -3707,16 +3707,16 @@ static struct fib6_info *rt6_multipath_first_sibling(const struct fib6_info *rt)
3707 struct fib6_info *iter; 3707 struct fib6_info *iter;
3708 struct fib6_node *fn; 3708 struct fib6_node *fn;
3709 3709
3710 fn = rcu_dereference_protected(rt->rt6i_node, 3710 fn = rcu_dereference_protected(rt->fib6_node,
3711 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 3711 lockdep_is_held(&rt->fib6_table->tb6_lock));
3712 iter = rcu_dereference_protected(fn->leaf, 3712 iter = rcu_dereference_protected(fn->leaf,
3713 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 3713 lockdep_is_held(&rt->fib6_table->tb6_lock));
3714 while (iter) { 3714 while (iter) {
3715 if (iter->rt6i_metric == rt->rt6i_metric && 3715 if (iter->fib6_metric == rt->fib6_metric &&
3716 rt6_qualify_for_ecmp(iter)) 3716 rt6_qualify_for_ecmp(iter))
3717 return iter; 3717 return iter;
3718 iter = rcu_dereference_protected(iter->rt6_next, 3718 iter = rcu_dereference_protected(iter->rt6_next,
3719 lockdep_is_held(&rt->rt6i_table->tb6_lock)); 3719 lockdep_is_held(&rt->fib6_table->tb6_lock));
3720 } 3720 }
3721 3721
3722 return NULL; 3722 return NULL;
@@ -3726,7 +3726,7 @@ static bool rt6_is_dead(const struct fib6_info *rt)
3726{ 3726{
3727 if (rt->fib6_nh.nh_flags & RTNH_F_DEAD || 3727 if (rt->fib6_nh.nh_flags & RTNH_F_DEAD ||
3728 (rt->fib6_nh.nh_flags & RTNH_F_LINKDOWN && 3728 (rt->fib6_nh.nh_flags & RTNH_F_LINKDOWN &&
3729 rt->rt6i_idev->cnf.ignore_routes_with_linkdown)) 3729 rt->fib6_idev->cnf.ignore_routes_with_linkdown))
3730 return true; 3730 return true;
3731 3731
3732 return false; 3732 return false;
@@ -3740,7 +3740,7 @@ static int rt6_multipath_total_weight(const struct fib6_info *rt)
3740 if (!rt6_is_dead(rt)) 3740 if (!rt6_is_dead(rt))
3741 total += rt->fib6_nh.nh_weight; 3741 total += rt->fib6_nh.nh_weight;
3742 3742
3743 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) { 3743 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings) {
3744 if (!rt6_is_dead(iter)) 3744 if (!rt6_is_dead(iter))
3745 total += iter->fib6_nh.nh_weight; 3745 total += iter->fib6_nh.nh_weight;
3746 } 3746 }
@@ -3767,7 +3767,7 @@ static void rt6_multipath_upper_bound_set(struct fib6_info *rt, int total)
3767 3767
3768 rt6_upper_bound_set(rt, &weight, total); 3768 rt6_upper_bound_set(rt, &weight, total);
3769 3769
3770 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) 3770 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings)
3771 rt6_upper_bound_set(iter, &weight, total); 3771 rt6_upper_bound_set(iter, &weight, total);
3772} 3772}
3773 3773
@@ -3780,7 +3780,7 @@ void rt6_multipath_rebalance(struct fib6_info *rt)
3780 * then there is no need to rebalance upon the removal of every 3780 * then there is no need to rebalance upon the removal of every
3781 * sibling route. 3781 * sibling route.
3782 */ 3782 */
3783 if (!rt->rt6i_nsiblings || rt->should_flush) 3783 if (!rt->fib6_nsiblings || rt->should_flush)
3784 return; 3784 return;
3785 3785
3786 /* During lookup routes are evaluated in order, so we need to 3786 /* During lookup routes are evaluated in order, so we need to
@@ -3831,7 +3831,7 @@ static bool rt6_multipath_uses_dev(const struct fib6_info *rt,
3831 3831
3832 if (rt->fib6_nh.nh_dev == dev) 3832 if (rt->fib6_nh.nh_dev == dev)
3833 return true; 3833 return true;
3834 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) 3834 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings)
3835 if (iter->fib6_nh.nh_dev == dev) 3835 if (iter->fib6_nh.nh_dev == dev)
3836 return true; 3836 return true;
3837 3837
@@ -3843,7 +3843,7 @@ static void rt6_multipath_flush(struct fib6_info *rt)
3843 struct fib6_info *iter; 3843 struct fib6_info *iter;
3844 3844
3845 rt->should_flush = 1; 3845 rt->should_flush = 1;
3846 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) 3846 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings)
3847 iter->should_flush = 1; 3847 iter->should_flush = 1;
3848} 3848}
3849 3849
@@ -3856,7 +3856,7 @@ static unsigned int rt6_multipath_dead_count(const struct fib6_info *rt,
3856 if (rt->fib6_nh.nh_dev == down_dev || 3856 if (rt->fib6_nh.nh_dev == down_dev ||
3857 rt->fib6_nh.nh_flags & RTNH_F_DEAD) 3857 rt->fib6_nh.nh_flags & RTNH_F_DEAD)
3858 dead++; 3858 dead++;
3859 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) 3859 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings)
3860 if (iter->fib6_nh.nh_dev == down_dev || 3860 if (iter->fib6_nh.nh_dev == down_dev ||
3861 iter->fib6_nh.nh_flags & RTNH_F_DEAD) 3861 iter->fib6_nh.nh_flags & RTNH_F_DEAD)
3862 dead++; 3862 dead++;
@@ -3872,7 +3872,7 @@ static void rt6_multipath_nh_flags_set(struct fib6_info *rt,
3872 3872
3873 if (rt->fib6_nh.nh_dev == dev) 3873 if (rt->fib6_nh.nh_dev == dev)
3874 rt->fib6_nh.nh_flags |= nh_flags; 3874 rt->fib6_nh.nh_flags |= nh_flags;
3875 list_for_each_entry(iter, &rt->rt6i_siblings, rt6i_siblings) 3875 list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings)
3876 if (iter->fib6_nh.nh_dev == dev) 3876 if (iter->fib6_nh.nh_dev == dev)
3877 iter->fib6_nh.nh_flags |= nh_flags; 3877 iter->fib6_nh.nh_flags |= nh_flags;
3878} 3878}
@@ -3893,13 +3893,13 @@ static int fib6_ifdown(struct fib6_info *rt, void *p_arg)
3893 case NETDEV_DOWN: 3893 case NETDEV_DOWN:
3894 if (rt->should_flush) 3894 if (rt->should_flush)
3895 return -1; 3895 return -1;
3896 if (!rt->rt6i_nsiblings) 3896 if (!rt->fib6_nsiblings)
3897 return rt->fib6_nh.nh_dev == dev ? -1 : 0; 3897 return rt->fib6_nh.nh_dev == dev ? -1 : 0;
3898 if (rt6_multipath_uses_dev(rt, dev)) { 3898 if (rt6_multipath_uses_dev(rt, dev)) {
3899 unsigned int count; 3899 unsigned int count;
3900 3900
3901 count = rt6_multipath_dead_count(rt, dev); 3901 count = rt6_multipath_dead_count(rt, dev);
3902 if (rt->rt6i_nsiblings + 1 == count) { 3902 if (rt->fib6_nsiblings + 1 == count) {
3903 rt6_multipath_flush(rt); 3903 rt6_multipath_flush(rt);
3904 return -1; 3904 return -1;
3905 } 3905 }
@@ -3911,7 +3911,7 @@ static int fib6_ifdown(struct fib6_info *rt, void *p_arg)
3911 return -2; 3911 return -2;
3912 case NETDEV_CHANGE: 3912 case NETDEV_CHANGE:
3913 if (rt->fib6_nh.nh_dev != dev || 3913 if (rt->fib6_nh.nh_dev != dev ||
3914 rt->rt6i_flags & (RTF_LOCAL | RTF_ANYCAST)) 3914 rt->fib6_flags & (RTF_LOCAL | RTF_ANYCAST))
3915 break; 3915 break;
3916 rt->fib6_nh.nh_flags |= RTNH_F_LINKDOWN; 3916 rt->fib6_nh.nh_flags |= RTNH_F_LINKDOWN;
3917 rt6_multipath_rebalance(rt); 3917 rt6_multipath_rebalance(rt);
@@ -4188,10 +4188,10 @@ static void ip6_route_mpath_notify(struct fib6_info *rt,
4188 * nexthop. Since sibling routes are always added at the end of 4188 * nexthop. Since sibling routes are always added at the end of
4189 * the list, find the first sibling of the last route appended 4189 * the list, find the first sibling of the last route appended
4190 */ 4190 */
4191 if ((nlflags & NLM_F_APPEND) && rt_last && rt_last->rt6i_nsiblings) { 4191 if ((nlflags & NLM_F_APPEND) && rt_last && rt_last->fib6_nsiblings) {
4192 rt = list_first_entry(&rt_last->rt6i_siblings, 4192 rt = list_first_entry(&rt_last->fib6_siblings,
4193 struct fib6_info, 4193 struct fib6_info,
4194 rt6i_siblings); 4194 fib6_siblings);
4195 } 4195 }
4196 4196
4197 if (rt) 4197 if (rt)
@@ -4410,13 +4410,13 @@ static size_t rt6_nlmsg_size(struct fib6_info *rt)
4410{ 4410{
4411 int nexthop_len = 0; 4411 int nexthop_len = 0;
4412 4412
4413 if (rt->rt6i_nsiblings) { 4413 if (rt->fib6_nsiblings) {
4414 nexthop_len = nla_total_size(0) /* RTA_MULTIPATH */ 4414 nexthop_len = nla_total_size(0) /* RTA_MULTIPATH */
4415 + NLA_ALIGN(sizeof(struct rtnexthop)) 4415 + NLA_ALIGN(sizeof(struct rtnexthop))
4416 + nla_total_size(16) /* RTA_GATEWAY */ 4416 + nla_total_size(16) /* RTA_GATEWAY */
4417 + lwtunnel_get_encap_size(rt->fib6_nh.nh_lwtstate); 4417 + lwtunnel_get_encap_size(rt->fib6_nh.nh_lwtstate);
4418 4418
4419 nexthop_len *= rt->rt6i_nsiblings; 4419 nexthop_len *= rt->fib6_nsiblings;
4420 } 4420 }
4421 4421
4422 return NLMSG_ALIGN(sizeof(struct rtmsg)) 4422 return NLMSG_ALIGN(sizeof(struct rtmsg))
@@ -4444,11 +4444,11 @@ static int rt6_nexthop_info(struct sk_buff *skb, struct fib6_info *rt,
4444 4444
4445 if (rt->fib6_nh.nh_flags & RTNH_F_LINKDOWN) { 4445 if (rt->fib6_nh.nh_flags & RTNH_F_LINKDOWN) {
4446 *flags |= RTNH_F_LINKDOWN; 4446 *flags |= RTNH_F_LINKDOWN;
4447 if (rt->rt6i_idev->cnf.ignore_routes_with_linkdown) 4447 if (rt->fib6_idev->cnf.ignore_routes_with_linkdown)
4448 *flags |= RTNH_F_DEAD; 4448 *flags |= RTNH_F_DEAD;
4449 } 4449 }
4450 4450
4451 if (rt->rt6i_flags & RTF_GATEWAY) { 4451 if (rt->fib6_flags & RTF_GATEWAY) {
4452 if (nla_put_in6_addr(skb, RTA_GATEWAY, &rt->fib6_nh.nh_gw) < 0) 4452 if (nla_put_in6_addr(skb, RTA_GATEWAY, &rt->fib6_nh.nh_gw) < 0)
4453 goto nla_put_failure; 4453 goto nla_put_failure;
4454 } 4454 }
@@ -4518,11 +4518,11 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4518 4518
4519 rtm = nlmsg_data(nlh); 4519 rtm = nlmsg_data(nlh);
4520 rtm->rtm_family = AF_INET6; 4520 rtm->rtm_family = AF_INET6;
4521 rtm->rtm_dst_len = rt->rt6i_dst.plen; 4521 rtm->rtm_dst_len = rt->fib6_dst.plen;
4522 rtm->rtm_src_len = rt->rt6i_src.plen; 4522 rtm->rtm_src_len = rt->fib6_src.plen;
4523 rtm->rtm_tos = 0; 4523 rtm->rtm_tos = 0;
4524 if (rt->rt6i_table) 4524 if (rt->fib6_table)
4525 table = rt->rt6i_table->tb6_id; 4525 table = rt->fib6_table->tb6_id;
4526 else 4526 else
4527 table = RT6_TABLE_UNSPEC; 4527 table = RT6_TABLE_UNSPEC;
4528 rtm->rtm_table = table; 4528 rtm->rtm_table = table;
@@ -4532,9 +4532,9 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4532 rtm->rtm_type = rt->fib6_type; 4532 rtm->rtm_type = rt->fib6_type;
4533 rtm->rtm_flags = 0; 4533 rtm->rtm_flags = 0;
4534 rtm->rtm_scope = RT_SCOPE_UNIVERSE; 4534 rtm->rtm_scope = RT_SCOPE_UNIVERSE;
4535 rtm->rtm_protocol = rt->rt6i_protocol; 4535 rtm->rtm_protocol = rt->fib6_protocol;
4536 4536
4537 if (rt->rt6i_flags & RTF_CACHE) 4537 if (rt->fib6_flags & RTF_CACHE)
4538 rtm->rtm_flags |= RTM_F_CLONED; 4538 rtm->rtm_flags |= RTM_F_CLONED;
4539 4539
4540 if (dest) { 4540 if (dest) {
@@ -4542,7 +4542,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4542 goto nla_put_failure; 4542 goto nla_put_failure;
4543 rtm->rtm_dst_len = 128; 4543 rtm->rtm_dst_len = 128;
4544 } else if (rtm->rtm_dst_len) 4544 } else if (rtm->rtm_dst_len)
4545 if (nla_put_in6_addr(skb, RTA_DST, &rt->rt6i_dst.addr)) 4545 if (nla_put_in6_addr(skb, RTA_DST, &rt->fib6_dst.addr))
4546 goto nla_put_failure; 4546 goto nla_put_failure;
4547#ifdef CONFIG_IPV6_SUBTREES 4547#ifdef CONFIG_IPV6_SUBTREES
4548 if (src) { 4548 if (src) {
@@ -4550,12 +4550,12 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4550 goto nla_put_failure; 4550 goto nla_put_failure;
4551 rtm->rtm_src_len = 128; 4551 rtm->rtm_src_len = 128;
4552 } else if (rtm->rtm_src_len && 4552 } else if (rtm->rtm_src_len &&
4553 nla_put_in6_addr(skb, RTA_SRC, &rt->rt6i_src.addr)) 4553 nla_put_in6_addr(skb, RTA_SRC, &rt->fib6_src.addr))
4554 goto nla_put_failure; 4554 goto nla_put_failure;
4555#endif 4555#endif
4556 if (iif) { 4556 if (iif) {
4557#ifdef CONFIG_IPV6_MROUTE 4557#ifdef CONFIG_IPV6_MROUTE
4558 if (ipv6_addr_is_multicast(&rt->rt6i_dst.addr)) { 4558 if (ipv6_addr_is_multicast(&rt->fib6_dst.addr)) {
4559 int err = ip6mr_get_route(net, skb, rtm, portid); 4559 int err = ip6mr_get_route(net, skb, rtm, portid);
4560 4560
4561 if (err == 0) 4561 if (err == 0)
@@ -4573,9 +4573,9 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4573 goto nla_put_failure; 4573 goto nla_put_failure;
4574 } 4574 }
4575 4575
4576 if (rt->rt6i_prefsrc.plen) { 4576 if (rt->fib6_prefsrc.plen) {
4577 struct in6_addr saddr_buf; 4577 struct in6_addr saddr_buf;
4578 saddr_buf = rt->rt6i_prefsrc.addr; 4578 saddr_buf = rt->fib6_prefsrc.addr;
4579 if (nla_put_in6_addr(skb, RTA_PREFSRC, &saddr_buf)) 4579 if (nla_put_in6_addr(skb, RTA_PREFSRC, &saddr_buf))
4580 goto nla_put_failure; 4580 goto nla_put_failure;
4581 } 4581 }
@@ -4584,13 +4584,13 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4584 if (rtnetlink_put_metrics(skb, pmetrics) < 0) 4584 if (rtnetlink_put_metrics(skb, pmetrics) < 0)
4585 goto nla_put_failure; 4585 goto nla_put_failure;
4586 4586
4587 if (nla_put_u32(skb, RTA_PRIORITY, rt->rt6i_metric)) 4587 if (nla_put_u32(skb, RTA_PRIORITY, rt->fib6_metric))
4588 goto nla_put_failure; 4588 goto nla_put_failure;
4589 4589
4590 /* For multipath routes, walk the siblings list and add 4590 /* For multipath routes, walk the siblings list and add
4591 * each as a nexthop within RTA_MULTIPATH. 4591 * each as a nexthop within RTA_MULTIPATH.
4592 */ 4592 */
4593 if (rt->rt6i_nsiblings) { 4593 if (rt->fib6_nsiblings) {
4594 struct fib6_info *sibling, *next_sibling; 4594 struct fib6_info *sibling, *next_sibling;
4595 struct nlattr *mp; 4595 struct nlattr *mp;
4596 4596
@@ -4602,7 +4602,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4602 goto nla_put_failure; 4602 goto nla_put_failure;
4603 4603
4604 list_for_each_entry_safe(sibling, next_sibling, 4604 list_for_each_entry_safe(sibling, next_sibling,
4605 &rt->rt6i_siblings, rt6i_siblings) { 4605 &rt->fib6_siblings, fib6_siblings) {
4606 if (rt6_add_nexthop(skb, sibling) < 0) 4606 if (rt6_add_nexthop(skb, sibling) < 0)
4607 goto nla_put_failure; 4607 goto nla_put_failure;
4608 } 4608 }
@@ -4613,7 +4613,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4613 goto nla_put_failure; 4613 goto nla_put_failure;
4614 } 4614 }
4615 4615
4616 if (rt->rt6i_flags & RTF_EXPIRES) { 4616 if (rt->fib6_flags & RTF_EXPIRES) {
4617 expires = dst ? dst->expires : rt->expires; 4617 expires = dst ? dst->expires : rt->expires;
4618 expires -= jiffies; 4618 expires -= jiffies;
4619 } 4619 }
@@ -4621,7 +4621,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4621 if (rtnl_put_cacheinfo(skb, dst, 0, expires, dst ? dst->error : 0) < 0) 4621 if (rtnl_put_cacheinfo(skb, dst, 0, expires, dst ? dst->error : 0) < 0)
4622 goto nla_put_failure; 4622 goto nla_put_failure;
4623 4623
4624 if (nla_put_u8(skb, RTA_PREF, IPV6_EXTRACT_PREF(rt->rt6i_flags))) 4624 if (nla_put_u8(skb, RTA_PREF, IPV6_EXTRACT_PREF(rt->fib6_flags)))
4625 goto nla_put_failure; 4625 goto nla_put_failure;
4626 4626
4627 4627
@@ -4646,7 +4646,7 @@ int rt6_dump_route(struct fib6_info *rt, void *p_arg)
4646 4646
4647 /* user wants prefix routes only */ 4647 /* user wants prefix routes only */
4648 if (rtm->rtm_flags & RTM_F_PREFIX && 4648 if (rtm->rtm_flags & RTM_F_PREFIX &&
4649 !(rt->rt6i_flags & RTF_PREFIX_RT)) { 4649 !(rt->fib6_flags & RTF_PREFIX_RT)) {
4650 /* success since this is not a prefix route */ 4650 /* success since this is not a prefix route */
4651 return 1; 4651 return 1;
4652 } 4652 }
@@ -4820,7 +4820,7 @@ static int ip6_route_dev_notify(struct notifier_block *this,
4820 4820
4821 if (event == NETDEV_REGISTER) { 4821 if (event == NETDEV_REGISTER) {
4822 net->ipv6.fib6_null_entry->fib6_nh.nh_dev = dev; 4822 net->ipv6.fib6_null_entry->fib6_nh.nh_dev = dev;
4823 net->ipv6.fib6_null_entry->rt6i_idev = in6_dev_get(dev); 4823 net->ipv6.fib6_null_entry->fib6_idev = in6_dev_get(dev);
4824 net->ipv6.ip6_null_entry->dst.dev = dev; 4824 net->ipv6.ip6_null_entry->dst.dev = dev;
4825 net->ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(dev); 4825 net->ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(dev);
4826#ifdef CONFIG_IPV6_MULTIPLE_TABLES 4826#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -4834,7 +4834,7 @@ static int ip6_route_dev_notify(struct notifier_block *this,
4834 /* NETDEV_UNREGISTER could be fired for multiple times by 4834 /* NETDEV_UNREGISTER could be fired for multiple times by
4835 * netdev_wait_allrefs(). Make sure we only call this once. 4835 * netdev_wait_allrefs(). Make sure we only call this once.
4836 */ 4836 */
4837 in6_dev_put_clear(&net->ipv6.fib6_null_entry->rt6i_idev); 4837 in6_dev_put_clear(&net->ipv6.fib6_null_entry->fib6_idev);
4838 in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); 4838 in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
4839#ifdef CONFIG_IPV6_MULTIPLE_TABLES 4839#ifdef CONFIG_IPV6_MULTIPLE_TABLES
4840 in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); 4840 in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -5157,7 +5157,7 @@ void __init ip6_route_init_special_entries(void)
5157 * the loopback reference in rt6_info will not be taken, do it 5157 * the loopback reference in rt6_info will not be taken, do it
5158 * manually for init_net */ 5158 * manually for init_net */
5159 init_net.ipv6.fib6_null_entry->fib6_nh.nh_dev = init_net.loopback_dev; 5159 init_net.ipv6.fib6_null_entry->fib6_nh.nh_dev = init_net.loopback_dev;
5160 init_net.ipv6.fib6_null_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); 5160 init_net.ipv6.fib6_null_entry->fib6_idev = in6_dev_get(init_net.loopback_dev);
5161 init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; 5161 init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev;
5162 init_net.ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); 5162 init_net.ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
5163 #ifdef CONFIG_IPV6_MULTIPLE_TABLES 5163 #ifdef CONFIG_IPV6_MULTIPLE_TABLES