forked from Mirror/frr
zebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED
The flag ROUTE_ENTRY_NEXTHOPS_CHANGED is only ever set or unset. Since this flag is not used for anything useful, remove from system. By changing this flag we have re-ordered `internalStatus' of json output of zebra rib routes. Go through and fix up tetsts to use the new values. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
b5046a3c50
commit
42fc558ee3
|
@ -8,7 +8,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.0.3.0/24",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r1-eth0",
|
||||
|
@ -30,7 +30,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.2/32",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r1-eth0",
|
||||
|
@ -52,7 +52,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.1/32",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:4::/64",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r1-eth0",
|
||||
|
@ -27,7 +27,7 @@
|
|||
"protocol": "bgp",
|
||||
"internalFlags": 0,
|
||||
"metric": 0,
|
||||
"internalStatus": 2,
|
||||
"internalStatus": 0,
|
||||
"prefix": "2001:db8:1::/64",
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -47,7 +47,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:1::/64",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"protocol": "ospf",
|
||||
"internalFlags": 0,
|
||||
"metric": 10,
|
||||
"internalStatus": 2,
|
||||
"internalStatus": 0,
|
||||
"prefix": "10.0.3.0/24",
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.0.3.0/24",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -47,7 +47,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.3/32",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r2-eth1",
|
||||
|
@ -70,7 +70,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.2/32",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -92,7 +92,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.1/32",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r2-eth0",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"protocol": "ospf6",
|
||||
"internalFlags": 0,
|
||||
"metric": 10,
|
||||
"internalStatus": 2,
|
||||
"internalStatus": 0,
|
||||
"prefix": "2001:db8:4::/64",
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:4::/64",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -47,7 +47,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:1::/64",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.0.3.0/24",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -47,7 +47,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.3/32",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -69,7 +69,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.2/32",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r3-eth0",
|
||||
|
@ -92,7 +92,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.1/32",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r3-eth0",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "10.254.254.4/32",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"protocol": "ospf6",
|
||||
"internalFlags": 0,
|
||||
"metric": 10,
|
||||
"internalStatus": 2,
|
||||
"internalStatus": 0,
|
||||
"prefix": "2001:db8:4::/64",
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:4::/64",
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"directlyConnected": true,
|
||||
|
@ -47,7 +47,7 @@
|
|||
"selected": true,
|
||||
"installed": true,
|
||||
"prefix": "2001:db8:1::/64",
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"nexthops": [
|
||||
{
|
||||
"interfaceName": "r4-eth0",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"distance": 20,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -33,7 +33,7 @@
|
|||
"distance": 0,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"vrfId":3,
|
||||
"distance": 20,
|
||||
"metric": 0,
|
||||
"internalStatus": 2,
|
||||
"internalStatus": 0,
|
||||
"internalFlags": 0,
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
|||
"distance": 0,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"distance": 0,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
@ -33,7 +33,7 @@
|
|||
"distance": 20,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 34,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"distance": 0,
|
||||
"metric": 0,
|
||||
"installed": true,
|
||||
"internalStatus": 32,
|
||||
"internalStatus": 16,
|
||||
"internalFlags": 8,
|
||||
"nexthops": [
|
||||
{
|
||||
|
|
12
zebra/rib.h
12
zebra/rib.h
|
@ -124,18 +124,16 @@ struct route_entry {
|
|||
/* RIB internal status */
|
||||
uint32_t status;
|
||||
#define ROUTE_ENTRY_REMOVED 0x1
|
||||
/* to simplify NHT logic when NHs change, instead of doing a NH by NH cmp */
|
||||
#define ROUTE_ENTRY_NEXTHOPS_CHANGED 0x2
|
||||
/* The Route Entry has changed */
|
||||
#define ROUTE_ENTRY_CHANGED 0x4
|
||||
#define ROUTE_ENTRY_CHANGED 0x2
|
||||
/* The Label has changed on the Route entry */
|
||||
#define ROUTE_ENTRY_LABELS_CHANGED 0x8
|
||||
#define ROUTE_ENTRY_LABELS_CHANGED 0x4
|
||||
/* Route is queued for Installation into the Data Plane */
|
||||
#define ROUTE_ENTRY_QUEUED 0x10
|
||||
#define ROUTE_ENTRY_QUEUED 0x8
|
||||
/* Route is installed into the Data Plane */
|
||||
#define ROUTE_ENTRY_INSTALLED 0x20
|
||||
#define ROUTE_ENTRY_INSTALLED 0x10
|
||||
/* Route has Failed installation into the Data Plane in some manner */
|
||||
#define ROUTE_ENTRY_FAILED 0x40
|
||||
#define ROUTE_ENTRY_FAILED 0x20
|
||||
|
||||
/* Nexthop information. */
|
||||
uint8_t nexthop_num;
|
||||
|
|
|
@ -272,8 +272,6 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
|
|||
|
||||
SET_FLAG(nexthop->flags,
|
||||
NEXTHOP_FLAG_RECURSIVE);
|
||||
SET_FLAG(re->status,
|
||||
ROUTE_ENTRY_NEXTHOPS_CHANGED);
|
||||
nexthop_set_resolved(afi, newhop, nexthop);
|
||||
resolved = 1;
|
||||
}
|
||||
|
@ -501,10 +499,8 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
|
|||
&& nexthop->type < NEXTHOP_TYPE_BLACKHOLE)
|
||||
&& !(IPV6_ADDR_SAME(&prev_src.ipv6,
|
||||
&nexthop->rmap_src.ipv6)))
|
||||
|| CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED)) {
|
||||
|| CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED))
|
||||
SET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
|
||||
SET_FLAG(re->status, ROUTE_ENTRY_NEXTHOPS_CHANGED);
|
||||
}
|
||||
}
|
||||
|
||||
return re->nexthop_active_num;
|
||||
|
|
|
@ -1128,8 +1128,6 @@ static void rib_process(struct route_node *rn)
|
|||
re->status, re->flags, re->distance,
|
||||
re->metric);
|
||||
|
||||
UNSET_FLAG(re->status, ROUTE_ENTRY_NEXTHOPS_CHANGED);
|
||||
|
||||
/* Currently selected re. */
|
||||
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED)) {
|
||||
assert(old_selected == NULL);
|
||||
|
|
|
@ -859,10 +859,8 @@ static void zebra_rnh_clear_nhc_flag(struct zebra_vrf *zvrf, afi_t afi,
|
|||
re = zebra_rnh_resolve_nexthop_entry(zvrf, afi, nrn, rnh,
|
||||
&prn);
|
||||
|
||||
if (re) {
|
||||
UNSET_FLAG(re->status, ROUTE_ENTRY_NEXTHOPS_CHANGED);
|
||||
if (re)
|
||||
UNSET_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED);
|
||||
}
|
||||
}
|
||||
|
||||
/* Evaluate all tracked entries (nexthops or routes for import into BGP)
|
||||
|
|
Loading…
Reference in a new issue