]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED 4746/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 18:53:58 +0000 (14:53 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 18:53:58 +0000 (14:53 -0400)
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>
15 files changed:
tests/topotests/bfd-topo2/r1/ipv4_routes.json
tests/topotests/bfd-topo2/r1/ipv6_routes.json
tests/topotests/bfd-topo2/r2/ipv4_routes.json
tests/topotests/bfd-topo2/r2/ipv6_routes.json
tests/topotests/bfd-topo2/r3/ipv4_routes.json
tests/topotests/bfd-topo2/r4/ipv4_routes.json
tests/topotests/bfd-topo2/r4/ipv6_routes.json
tests/topotests/bgp_vrf_lite_ipv6_rtadv/r1/ipv4_routes.json
tests/topotests/bgp_vrf_lite_ipv6_rtadv/r1/ipv6_routes.json
tests/topotests/bgp_vrf_lite_ipv6_rtadv/r2/ipv4_routes.json
tests/topotests/bgp_vrf_lite_ipv6_rtadv/r2/ipv6_routes.json
zebra/rib.h
zebra/zebra_nhg.c
zebra/zebra_rib.c
zebra/zebra_rnh.c

index 8a2ec25baa9c4a6143c010d755bc3c67fc7a66fe..b0333de410b322129a11ff56a16c94c8b6108c47 100644 (file)
@@ -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,
index 618853bd42cf573abc24f68c133d8923acae933c..d09439a8a63aa938d3ddb9bfaa0094863ce52e94 100644 (file)
@@ -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,
index b9d8afb430b6fde792f49723e61798e97612a89e..3c41e134349bb49f96a021df580f2cab99f7e643 100644 (file)
@@ -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",
index 004e7588aa68826da10e17b9956de8199f2d4052..bb45bbae52837678737ee3fa8265593cc2ad1081 100644 (file)
@@ -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,
index 14dfc692fe8cfd42005e63be1a55bdaad1c0327c..cbf116e6879e12298355da42ab9adeffa07013e1 100644 (file)
@@ -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",
index ae1e97b0172bf58fe9d4fc31b71675241f418f80..b06184a44d7545d83f7c0f0b7ac23bc3c200f71d 100644 (file)
@@ -8,7 +8,7 @@
       "selected": true,
       "installed": true,
       "prefix": "10.254.254.4/32",
-      "internalStatus": 32,
+      "internalStatus": 16,
       "nexthops": [
         {
           "directlyConnected": true,
index 33608b45aa5f661c967dd9b85a81b1be261d5f85..a22c90cbbaeea8454fe8919646a75fae3a20c172 100644 (file)
@@ -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",
index e32c84b7d57aa950b0febcb462ff0f7e0d773015..1649ade96d37a9eb3f180b960a46ea010b16aaf5 100644 (file)
@@ -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": [
                 {
index 88e8c5cd8306b7c6cb14c5a96728e2aac706c067..1ca62094bdfc9af1259f93ef04afd1837a5e991a 100644 (file)
@@ -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": [
         {
index 9d7c0e6e4f118dca9937798016e0206cea1d21a6..eda4bed0351d27cf3dd9b0f92de243216a6d8ad4 100644 (file)
@@ -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": [
         {
index 230fe38748dedd1e00f86cebfa4cac68e637edf9..45c1b76017319b041c5f239d83e9e83fed8332e1 100644 (file)
@@ -9,7 +9,7 @@
       "distance": 0,
       "metric": 0,
       "installed": true,
-      "internalStatus": 32,
+      "internalStatus": 16,
       "internalFlags": 8,
       "nexthops": [
         {
index 181286a904947eff0613a53282c2f4a579787576..b82428e54c566a5bd5a63734e7107ab83fcc1f25 100644 (file)
@@ -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;
index 4a88296051a9a79efd7a578fad73d14c715da36c..d12360255089892a36fd51efe9d847ed0c6b73a1 100644 (file)
@@ -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;
index 5dcf21f561fccd2c89b1152c563748634cd4940b..479e9716853a2d88cf9ae0ab90e5fade1cde1e3e 100644 (file)
@@ -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);
index 6f65f8ab7a1d917b3b24a4fd2d72c5631d5fb8ad..5a10892d9af7ae814628b56af17e5cdf963fed26 100644 (file)
@@ -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)