diff options
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 4797a800faf8..8f6cb7a87cd6 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -298,14 +298,13 @@ static inline unsigned int fib_info_hashfn(const struct fib_info *fi) | |||
298 | static struct fib_info *fib_find_info(const struct fib_info *nfi) | 298 | static struct fib_info *fib_find_info(const struct fib_info *nfi) |
299 | { | 299 | { |
300 | struct hlist_head *head; | 300 | struct hlist_head *head; |
301 | struct hlist_node *node; | ||
302 | struct fib_info *fi; | 301 | struct fib_info *fi; |
303 | unsigned int hash; | 302 | unsigned int hash; |
304 | 303 | ||
305 | hash = fib_info_hashfn(nfi); | 304 | hash = fib_info_hashfn(nfi); |
306 | head = &fib_info_hash[hash]; | 305 | head = &fib_info_hash[hash]; |
307 | 306 | ||
308 | hlist_for_each_entry(fi, node, head, fib_hash) { | 307 | hlist_for_each_entry(fi, head, fib_hash) { |
309 | if (!net_eq(fi->fib_net, nfi->fib_net)) | 308 | if (!net_eq(fi->fib_net, nfi->fib_net)) |
310 | continue; | 309 | continue; |
311 | if (fi->fib_nhs != nfi->fib_nhs) | 310 | if (fi->fib_nhs != nfi->fib_nhs) |
@@ -331,7 +330,6 @@ static struct fib_info *fib_find_info(const struct fib_info *nfi) | |||
331 | int ip_fib_check_default(__be32 gw, struct net_device *dev) | 330 | int ip_fib_check_default(__be32 gw, struct net_device *dev) |
332 | { | 331 | { |
333 | struct hlist_head *head; | 332 | struct hlist_head *head; |
334 | struct hlist_node *node; | ||
335 | struct fib_nh *nh; | 333 | struct fib_nh *nh; |
336 | unsigned int hash; | 334 | unsigned int hash; |
337 | 335 | ||
@@ -339,7 +337,7 @@ int ip_fib_check_default(__be32 gw, struct net_device *dev) | |||
339 | 337 | ||
340 | hash = fib_devindex_hashfn(dev->ifindex); | 338 | hash = fib_devindex_hashfn(dev->ifindex); |
341 | head = &fib_info_devhash[hash]; | 339 | head = &fib_info_devhash[hash]; |
342 | hlist_for_each_entry(nh, node, head, nh_hash) { | 340 | hlist_for_each_entry(nh, head, nh_hash) { |
343 | if (nh->nh_dev == dev && | 341 | if (nh->nh_dev == dev && |
344 | nh->nh_gw == gw && | 342 | nh->nh_gw == gw && |
345 | !(nh->nh_flags & RTNH_F_DEAD)) { | 343 | !(nh->nh_flags & RTNH_F_DEAD)) { |
@@ -721,10 +719,10 @@ static void fib_info_hash_move(struct hlist_head *new_info_hash, | |||
721 | 719 | ||
722 | for (i = 0; i < old_size; i++) { | 720 | for (i = 0; i < old_size; i++) { |
723 | struct hlist_head *head = &fib_info_hash[i]; | 721 | struct hlist_head *head = &fib_info_hash[i]; |
724 | struct hlist_node *node, *n; | 722 | struct hlist_node *n; |
725 | struct fib_info *fi; | 723 | struct fib_info *fi; |
726 | 724 | ||
727 | hlist_for_each_entry_safe(fi, node, n, head, fib_hash) { | 725 | hlist_for_each_entry_safe(fi, n, head, fib_hash) { |
728 | struct hlist_head *dest; | 726 | struct hlist_head *dest; |
729 | unsigned int new_hash; | 727 | unsigned int new_hash; |
730 | 728 | ||
@@ -739,10 +737,10 @@ static void fib_info_hash_move(struct hlist_head *new_info_hash, | |||
739 | 737 | ||
740 | for (i = 0; i < old_size; i++) { | 738 | for (i = 0; i < old_size; i++) { |
741 | struct hlist_head *lhead = &fib_info_laddrhash[i]; | 739 | struct hlist_head *lhead = &fib_info_laddrhash[i]; |
742 | struct hlist_node *node, *n; | 740 | struct hlist_node *n; |
743 | struct fib_info *fi; | 741 | struct fib_info *fi; |
744 | 742 | ||
745 | hlist_for_each_entry_safe(fi, node, n, lhead, fib_lhash) { | 743 | hlist_for_each_entry_safe(fi, n, lhead, fib_lhash) { |
746 | struct hlist_head *ldest; | 744 | struct hlist_head *ldest; |
747 | unsigned int new_hash; | 745 | unsigned int new_hash; |
748 | 746 | ||
@@ -1096,13 +1094,12 @@ int fib_sync_down_addr(struct net *net, __be32 local) | |||
1096 | int ret = 0; | 1094 | int ret = 0; |
1097 | unsigned int hash = fib_laddr_hashfn(local); | 1095 | unsigned int hash = fib_laddr_hashfn(local); |
1098 | struct hlist_head *head = &fib_info_laddrhash[hash]; | 1096 | struct hlist_head *head = &fib_info_laddrhash[hash]; |
1099 | struct hlist_node *node; | ||
1100 | struct fib_info *fi; | 1097 | struct fib_info *fi; |
1101 | 1098 | ||
1102 | if (fib_info_laddrhash == NULL || local == 0) | 1099 | if (fib_info_laddrhash == NULL || local == 0) |
1103 | return 0; | 1100 | return 0; |
1104 | 1101 | ||
1105 | hlist_for_each_entry(fi, node, head, fib_lhash) { | 1102 | hlist_for_each_entry(fi, head, fib_lhash) { |
1106 | if (!net_eq(fi->fib_net, net)) | 1103 | if (!net_eq(fi->fib_net, net)) |
1107 | continue; | 1104 | continue; |
1108 | if (fi->fib_prefsrc == local) { | 1105 | if (fi->fib_prefsrc == local) { |
@@ -1120,13 +1117,12 @@ int fib_sync_down_dev(struct net_device *dev, int force) | |||
1120 | struct fib_info *prev_fi = NULL; | 1117 | struct fib_info *prev_fi = NULL; |
1121 | unsigned int hash = fib_devindex_hashfn(dev->ifindex); | 1118 | unsigned int hash = fib_devindex_hashfn(dev->ifindex); |
1122 | struct hlist_head *head = &fib_info_devhash[hash]; | 1119 | struct hlist_head *head = &fib_info_devhash[hash]; |
1123 | struct hlist_node *node; | ||
1124 | struct fib_nh *nh; | 1120 | struct fib_nh *nh; |
1125 | 1121 | ||
1126 | if (force) | 1122 | if (force) |
1127 | scope = -1; | 1123 | scope = -1; |
1128 | 1124 | ||
1129 | hlist_for_each_entry(nh, node, head, nh_hash) { | 1125 | hlist_for_each_entry(nh, head, nh_hash) { |
1130 | struct fib_info *fi = nh->nh_parent; | 1126 | struct fib_info *fi = nh->nh_parent; |
1131 | int dead; | 1127 | int dead; |
1132 | 1128 | ||
@@ -1232,7 +1228,6 @@ int fib_sync_up(struct net_device *dev) | |||
1232 | struct fib_info *prev_fi; | 1228 | struct fib_info *prev_fi; |
1233 | unsigned int hash; | 1229 | unsigned int hash; |
1234 | struct hlist_head *head; | 1230 | struct hlist_head *head; |
1235 | struct hlist_node *node; | ||
1236 | struct fib_nh *nh; | 1231 | struct fib_nh *nh; |
1237 | int ret; | 1232 | int ret; |
1238 | 1233 | ||
@@ -1244,7 +1239,7 @@ int fib_sync_up(struct net_device *dev) | |||
1244 | head = &fib_info_devhash[hash]; | 1239 | head = &fib_info_devhash[hash]; |
1245 | ret = 0; | 1240 | ret = 0; |
1246 | 1241 | ||
1247 | hlist_for_each_entry(nh, node, head, nh_hash) { | 1242 | hlist_for_each_entry(nh, head, nh_hash) { |
1248 | struct fib_info *fi = nh->nh_parent; | 1243 | struct fib_info *fi = nh->nh_parent; |
1249 | int alive; | 1244 | int alive; |
1250 | 1245 | ||