Skip to content

Commit 3e65a4f

Browse files
committed
route/nh: don't refer to the "resvd{1,2}" fields in nexthop_grp
These fields are reserved. Newer kernel headers will rename them. Don't directly refer to these fields. Instead, rely on their values being initialized to zero via struct initialization.
1 parent a9abc93 commit 3e65a4f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/route/nh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,10 @@ static int rtnl_nh_build_msg(struct nl_msg *msg, struct rtnl_nh *nh)
643643

644644
grp = nla_data(attr);
645645
for (unsigned int i = 0; i < nh->nh_group->size; i++) {
646-
grp[i].id = nh->nh_group->entries[i].nh_id;
647-
grp[i].weight = nh->nh_group->entries[i].weight;
648-
grp[i].resvd1 = 0;
649-
grp[i].resvd2 = 0;
646+
grp[i] = (struct nexthop_grp){
647+
.id = nh->nh_group->entries[i].nh_id,
648+
.weight = nh->nh_group->entries[i].weight,
649+
};
650650
}
651651

652652
/* Optional group type */

0 commit comments

Comments
 (0)