struct nexthop *nexthop;
if (re) {
- for (nexthop = re->ng.nexthop; nexthop;
+ for (nexthop = re->ng->nexthop; nexthop;
nexthop = nexthop->next) {
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_RNH_FILTERED);
}
route_map_result_t ret;
if (prn && re) {
- for (nexthop = re->ng.nexthop; nexthop;
+ for (nexthop = re->ng->nexthop; nexthop;
nexthop = nexthop->next) {
ret = zebra_nht_route_map_check(
afi, proto, &prn->p, zvrf, re, nexthop);
/* Just being SELECTED isn't quite enough - must
* have an installed nexthop to be useful.
*/
- for (ALL_NEXTHOPS(re->ng, nexthop)) {
+ for (ALL_NEXTHOPS_PTR(re->ng, nexthop)) {
if (rnh_nexthop_valid(re, nexthop))
break;
}
break;
if (re->type == ZEBRA_ROUTE_NHRP) {
- for (nexthop = re->ng.nexthop; nexthop;
+ for (nexthop = re->ng->nexthop; nexthop;
nexthop = nexthop->next)
if (nexthop->type
== NEXTHOP_TYPE_IFINDEX)
return;
/* free RE and nexthops */
- nexthops_free(re->ng.nexthop);
+ nexthops_free(re->ng->nexthop);
+ nexthop_group_delete(&re->ng);
XFREE(MTYPE_RE, re);
}
state->metric = re->metric;
state->vrf_id = re->vrf_id;
state->status = re->status;
+ state->ng = nexthop_group_new();
- route_entry_copy_nexthops(state, re->ng.nexthop);
+ route_entry_copy_nexthops(state, re->ng->nexthop);
rnh->state = state;
}
if (r1->nexthop_num != r2->nexthop_num)
return 1;
- if (nexthop_group_hash(&r1->ng) != nexthop_group_hash(&r2->ng))
+ if (nexthop_group_hash(r1->ng) != nexthop_group_hash(r2->ng))
return 1;
return 0;
num = 0;
nump = stream_get_endp(s);
stream_putc(s, 0);
- for (ALL_NEXTHOPS(re->ng, nh))
+ for (ALL_NEXTHOPS_PTR(re->ng, nh))
if (rnh_nexthop_valid(re, nh)) {
stream_putl(s, nh->vrf_id);
stream_putc(s, nh->type);
if (rnh->state) {
vty_out(vty, " resolved via %s\n",
zebra_route_string(rnh->state->type));
- for (nexthop = rnh->state->ng.nexthop; nexthop;
+ for (nexthop = rnh->state->ng->nexthop; nexthop;
nexthop = nexthop->next)
print_nh(nexthop, vty);
} else