Skip to content

Commit 5a1ccff

Browse files
q2venPaolo Abeni
authored andcommitted
ipv6: Rename rt6_nh.next to rt6_nh.list.
ip6_route_multipath_add() allocates struct rt6_nh for each config of multipath routes to link them to a local list rt6_nh_list. struct rt6_nh.next is the list node of each config, so the name is quite misleading. Let's rename it to list. Suggested-by: Paolo Abeni <[email protected]> Link: https://lore.kernel.org/netdev/[email protected]/ Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 87d5d92 commit 5a1ccff

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

net/ipv6/route.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5315,7 +5315,7 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
53155315
struct rt6_nh {
53165316
struct fib6_info *fib6_info;
53175317
struct fib6_config r_cfg;
5318-
struct list_head next;
5318+
struct list_head list;
53195319
};
53205320

53215321
static int ip6_route_info_append(struct list_head *rt6_nh_list,
@@ -5325,7 +5325,7 @@ static int ip6_route_info_append(struct list_head *rt6_nh_list,
53255325
struct rt6_nh *nh;
53265326
int err = -EEXIST;
53275327

5328-
list_for_each_entry(nh, rt6_nh_list, next) {
5328+
list_for_each_entry(nh, rt6_nh_list, list) {
53295329
/* check if fib6_info already exists */
53305330
if (rt6_duplicate_nexthop(nh->fib6_info, rt))
53315331
return err;
@@ -5336,7 +5336,7 @@ static int ip6_route_info_append(struct list_head *rt6_nh_list,
53365336
return -ENOMEM;
53375337
nh->fib6_info = rt;
53385338
memcpy(&nh->r_cfg, r_cfg, sizeof(*r_cfg));
5339-
list_add_tail(&nh->next, rt6_nh_list);
5339+
list_add_tail(&nh->list, rt6_nh_list);
53405340

53415341
return 0;
53425342
}
@@ -5479,7 +5479,7 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
54795479
info->skip_notify_kernel = 1;
54805480

54815481
err_nh = NULL;
5482-
list_for_each_entry(nh, &rt6_nh_list, next) {
5482+
list_for_each_entry(nh, &rt6_nh_list, list) {
54835483
err = __ip6_ins_rt(nh->fib6_info, info, extack);
54845484

54855485
if (err) {
@@ -5547,16 +5547,16 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
55475547
ip6_route_mpath_notify(rt_notif, rt_last, info, nlflags);
55485548

55495549
/* Delete routes that were already added */
5550-
list_for_each_entry(nh, &rt6_nh_list, next) {
5550+
list_for_each_entry(nh, &rt6_nh_list, list) {
55515551
if (err_nh == nh)
55525552
break;
55535553
ip6_route_del(&nh->r_cfg, extack);
55545554
}
55555555

55565556
cleanup:
5557-
list_for_each_entry_safe(nh, nh_safe, &rt6_nh_list, next) {
5557+
list_for_each_entry_safe(nh, nh_safe, &rt6_nh_list, list) {
55585558
fib6_info_release(nh->fib6_info);
5559-
list_del(&nh->next);
5559+
list_del(&nh->list);
55605560
kfree(nh);
55615561
}
55625562

0 commit comments

Comments
 (0)