mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 12:41:21 +00:00
zebra: Remove re->nexthop_num from re
The nexthop_num is not a function of the re. It is owned by the nexthop group. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
6b46851168
commit
eecacedc3b
@ -676,7 +676,6 @@ int zebra_add_import_table_entry(struct zebra_vrf *zvrf, struct route_node *rn,
|
|||||||
newre->metric = re->metric;
|
newre->metric = re->metric;
|
||||||
newre->mtu = re->mtu;
|
newre->mtu = re->mtu;
|
||||||
newre->table = zvrf->table_id;
|
newre->table = zvrf->table_id;
|
||||||
newre->nexthop_num = 0;
|
|
||||||
newre->uptime = monotime(NULL);
|
newre->uptime = monotime(NULL);
|
||||||
newre->instance = re->table;
|
newre->instance = re->table;
|
||||||
newre->ng = nexthop_group_new();
|
newre->ng = nexthop_group_new();
|
||||||
|
@ -136,7 +136,6 @@ struct route_entry {
|
|||||||
#define ROUTE_ENTRY_FAILED 0x20
|
#define ROUTE_ENTRY_FAILED 0x20
|
||||||
|
|
||||||
/* Nexthop information. */
|
/* Nexthop information. */
|
||||||
uint8_t nexthop_num;
|
|
||||||
uint8_t nexthop_active_num;
|
uint8_t nexthop_active_num;
|
||||||
|
|
||||||
/* Sequence value incremented for each dataplane operation */
|
/* Sequence value incremented for each dataplane operation */
|
||||||
|
@ -609,7 +609,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
&src_p, &nh, table, metric, mtu, distance, tag);
|
&src_p, &nh, table, metric, mtu, distance, tag);
|
||||||
} else {
|
} else {
|
||||||
/* This is a multipath route */
|
/* This is a multipath route */
|
||||||
|
uint8_t nhop_num;
|
||||||
struct route_entry *re;
|
struct route_entry *re;
|
||||||
struct rtnexthop *rtnh =
|
struct rtnexthop *rtnh =
|
||||||
(struct rtnexthop *)RTA_DATA(tb[RTA_MULTIPATH]);
|
(struct rtnexthop *)RTA_DATA(tb[RTA_MULTIPATH]);
|
||||||
@ -624,7 +624,6 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
re->mtu = mtu;
|
re->mtu = mtu;
|
||||||
re->vrf_id = vrf_id;
|
re->vrf_id = vrf_id;
|
||||||
re->table = table;
|
re->table = table;
|
||||||
re->nexthop_num = 0;
|
|
||||||
re->uptime = monotime(NULL);
|
re->uptime = monotime(NULL);
|
||||||
re->tag = tag;
|
re->tag = tag;
|
||||||
re->ng = nexthop_group_new();
|
re->ng = nexthop_group_new();
|
||||||
@ -720,10 +719,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
rtnh = RTNH_NEXT(rtnh);
|
rtnh = RTNH_NEXT(rtnh);
|
||||||
}
|
}
|
||||||
|
|
||||||
zserv_nexthop_num_warn(__func__,
|
nhop_num = nexthop_group_nexthop_num(re->ng);
|
||||||
(const struct prefix *)&p,
|
zserv_nexthop_num_warn(
|
||||||
re->nexthop_num);
|
__func__, (const struct prefix *)&p, nhop_num);
|
||||||
if (re->nexthop_num == 0) {
|
if (nhop_num == 0) {
|
||||||
nexthop_group_delete(&re->ng);
|
nexthop_group_delete(&re->ng);
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
} else
|
} else
|
||||||
|
@ -197,7 +197,6 @@ int zebra_check_addr(const struct prefix *p)
|
|||||||
void route_entry_nexthop_add(struct route_entry *re, struct nexthop *nexthop)
|
void route_entry_nexthop_add(struct route_entry *re, struct nexthop *nexthop)
|
||||||
{
|
{
|
||||||
_nexthop_group_add_sorted(re->ng, nexthop);
|
_nexthop_group_add_sorted(re->ng, nexthop);
|
||||||
re->nexthop_num++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -208,8 +207,6 @@ void route_entry_copy_nexthops(struct route_entry *re, struct nexthop *nh)
|
|||||||
{
|
{
|
||||||
assert(!re->ng->nexthop);
|
assert(!re->ng->nexthop);
|
||||||
copy_nexthops(&re->ng->nexthop, nh, NULL);
|
copy_nexthops(&re->ng->nexthop, nh, NULL);
|
||||||
for (struct nexthop *nexthop = nh; nexthop; nexthop = nexthop->next)
|
|
||||||
re->nexthop_num++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delete specified nexthop from the list. */
|
/* Delete specified nexthop from the list. */
|
||||||
@ -221,7 +218,6 @@ void route_entry_nexthop_delete(struct route_entry *re, struct nexthop *nexthop)
|
|||||||
nexthop->prev->next = nexthop->next;
|
nexthop->prev->next = nexthop->next;
|
||||||
else
|
else
|
||||||
re->ng->nexthop = nexthop->next;
|
re->ng->nexthop = nexthop->next;
|
||||||
re->nexthop_num--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2485,7 +2481,7 @@ void _route_entry_dump(const char *func, union prefixconstptr pp,
|
|||||||
"%s: metric == %u, mtu == %u, distance == %u, flags == %u, status == %u",
|
"%s: metric == %u, mtu == %u, distance == %u, flags == %u, status == %u",
|
||||||
straddr, re->metric, re->mtu, re->distance, re->flags, re->status);
|
straddr, re->metric, re->mtu, re->distance, re->flags, re->status);
|
||||||
zlog_debug("%s: nexthop_num == %u, nexthop_active_num == %u", straddr,
|
zlog_debug("%s: nexthop_num == %u, nexthop_active_num == %u", straddr,
|
||||||
re->nexthop_num, re->nexthop_active_num);
|
nexthop_group_nexthop_num(re->ng), re->nexthop_active_num);
|
||||||
|
|
||||||
for (ALL_NEXTHOPS_PTR(re->ng, nexthop)) {
|
for (ALL_NEXTHOPS_PTR(re->ng, nexthop)) {
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
@ -2959,7 +2955,6 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
|||||||
re->mtu = mtu;
|
re->mtu = mtu;
|
||||||
re->table = table_id;
|
re->table = table_id;
|
||||||
re->vrf_id = vrf_id;
|
re->vrf_id = vrf_id;
|
||||||
re->nexthop_num = 0;
|
|
||||||
re->uptime = monotime(NULL);
|
re->uptime = monotime(NULL);
|
||||||
re->tag = tag;
|
re->tag = tag;
|
||||||
re->ng = nexthop_group_new();
|
re->ng = nexthop_group_new();
|
||||||
|
@ -984,7 +984,8 @@ static int compare_state(struct route_entry *r1, struct route_entry *r2)
|
|||||||
if (r1->metric != r2->metric)
|
if (r1->metric != r2->metric)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (r1->nexthop_num != r2->nexthop_num)
|
if (nexthop_group_nexthop_num(r1->ng)
|
||||||
|
!= nexthop_group_nexthop_num(r2->ng))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (nexthop_group_hash(r1->ng) != nexthop_group_hash(r2->ng))
|
if (nexthop_group_hash(r1->ng) != nexthop_group_hash(r2->ng))
|
||||||
|
Loading…
Reference in New Issue
Block a user