]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: create routes for local destinations
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 16 Oct 2020 23:57:37 +0000 (20:57 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 23 Oct 2020 13:30:36 +0000 (10:30 -0300)
This is preparatory change for the upcoming SR Prefix-SID
refactoring.
Since Prefix-SID information will be stored inside IS-IS routes
(instead of being maintained separately), it will be necessary to
have local routes in order to store local Prefix-SID information.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd/isis_lfa.c
isisd/isis_spf.c
tests/topotests/isis-topo1-vrf/r1/r1_route.json
tests/topotests/isis-topo1-vrf/r2/r2_route.json
tests/topotests/isis-topo1-vrf/r3/r3_route.json
tests/topotests/isis-topo1-vrf/r4/r4_route.json
tests/topotests/isis-topo1/r1/r1_route.json
tests/topotests/isis-topo1/r2/r2_route.json
tests/topotests/isis-topo1/r3/r3_route.json
tests/topotests/isis-topo1/r4/r4_route.json

index 8ca432f895d37b7eb15bd2abe63959e14dc34826..f3d4091f3ea6bc5660c28ae55068f0fbc42efc76 100644 (file)
@@ -614,6 +614,10 @@ static bool lfa_check_needs_protection(const struct isis_spftree *spftree_pc,
        size_t affected_nhs = 0;
        struct isis_vertex_adj *vadj;
 
+       /* Local routes don't need protection. */
+       if (VTYPE_IP(vertex->type) && vertex->depth == 1)
+               return false;
+
        /* Only local adjacencies need Adj-SID protection. */
        if (VTYPE_IS(vertex->type)
            && !isis_adj_find(spftree_pc->area, spftree_pc->level,
index 138095fa0cd0fa641e3de8810c5f42c61ae04b40..dacf4e14ecb3c137be3b093b0b55955eeb2dd892 100644 (file)
@@ -1280,7 +1280,7 @@ static void spf_path_process(struct isis_spftree *spftree,
 
        if (VTYPE_IP(vertex->type)
            && !CHECK_FLAG(spftree->flags, F_SPFTREE_NO_ROUTES)) {
-               if (listcount(vertex->Adj_N) > 0) {
+               if (vertex->depth == 1 || listcount(vertex->Adj_N) > 0) {
                        struct route_table *route_table;
 
                        if (spftree->type == SPF_TYPE_TI_LFA) {
index 77d2ad9c6302aff87a5aa0c32e644ce885e69e42..f0a3593a4c4e72a4ce8296eb85c73627dcb5594d 100644 (file)
     }
   ], 
   "10.0.20.0/24": [
-    {
-      "distance": 115, 
-      "metric": 20, 
-      "nexthops": [
-        {
-          "afi": "ipv4", 
-          "interfaceName": "r1-eth0", 
-          "ip": "10.0.20.1" 
-        }
-      ], 
-      "prefix": "10.0.20.0/24", 
-      "protocol": "isis", 
-      "vrfName": "r1-cust1"
-    }, 
     {
       "nexthops": [
         {
index 98252c59399749158fbc981627bd6014e55060c9..a26cdfad8eb68c4536944e2ce8d31bcce0be7f75 100644 (file)
     }
   ], 
   "10.0.21.0/24": [
-    {
-      "distance": 115, 
-      "metric": 20, 
-      "nexthops": [
-        {
-          "afi": "ipv4", 
-          "interfaceName": "r2-eth0", 
-          "ip": "10.0.21.1" 
-        }
-      ], 
-      "prefix": "10.0.21.0/24", 
-      "protocol": "isis", 
-      "vrfName": "r2-cust1"
-    }, 
     {
       "nexthops": [
         {
index de158876f198c9a9ef512dab89fa932124477cb0..9717df5c1afdeb7d85b305e216b336ba87e50d8a 100644 (file)
     }
   ], 
   "10.0.20.0/24": [
-    {
-      "distance": 115, 
-      "metric": 20, 
-      "nexthops": [
-        {
-          "afi": "ipv4", 
-          "interfaceName": "r3-eth0", 
-          "ip": "10.0.20.2" 
-        }
-      ], 
-      "prefix": "10.0.20.0/24", 
-      "protocol": "isis", 
-      "vrfName": "r3-cust1"
-    }, 
     {
       "nexthops": [
         {
index b3ed4f2cbe9604acf13181709f32626297f1d36c..6cb79b03015d9a9a6647ade61f2ba71c20035fb3 100644 (file)
     }
   ], 
   "10.0.21.0/24": [
-    {
-      "nexthops": [
-        {
-          "afi": "ipv4", 
-          "interfaceName": "r4-eth0", 
-          "ip": "10.0.21.2" 
-        }
-      ], 
-      "prefix": "10.0.21.0/24", 
-      "protocol": "isis", 
-      "vrfName": "r4-cust1"
-    }, 
     {
       "nexthops": [
         {
index 123b4dd16333488f3f238262ce3f1949f0eddd17..f94233a80f56f139bcaa66036cc1f2fc19febeff 100644 (file)
     }
   ],
   "10.0.20.0/24": [
-    {
-      "distance": 115,
-      "metric": 10,
-      "nexthops": [
-        {
-          "afi": "ipv4",
-          "interfaceName": "r1-eth0",
-          "ip": "10.0.20.1"
-        }
-      ],
-      "prefix": "10.0.20.0/24",
-      "protocol": "isis"
-    },
     {
       "nexthops": [
         {
index fe2de057342bcf4d6c714be677b5aa1df8b0d7dd..aab651eff056f6b4bbd19e0205ae9050a4d674bf 100644 (file)
     }
   ],
   "10.0.21.0/24": [
-    {
-      "distance": 115,
-      "metric": 10,
-      "nexthops": [
-        {
-          "afi": "ipv4",
-          "interfaceName": "r2-eth0",
-          "ip": "10.0.21.1"
-        }
-      ],
-      "prefix": "10.0.21.0/24",
-      "protocol": "isis"
-    },
     {
       "nexthops": [
         {
index 1f0fcdfcd6471110b3a226b4978a7d991374a8ee..61d05e80bbfeb5fcfed735bab4d2b83a8b970117 100644 (file)
     }
   ],
   "10.0.20.0/24": [
-    {
-      "distance": 115,
-      "metric": 10,
-      "nexthops": [
-        {
-          "afi": "ipv4",
-          "interfaceName": "r3-eth0",
-          "ip": "10.0.20.2"
-        }
-      ],
-      "prefix": "10.0.20.0/24",
-      "protocol": "isis"
-    },
     {
       "nexthops": [
         {
index 597e953c09faf4ff7961b5ae35bac76c726e2a9e..79361af4b566ed0414ba06713a61bf33c563aee0 100644 (file)
     }
   ],
   "10.0.21.0/24": [
-    {
-      "distance": 115,
-      "metric": 10,
-      "nexthops": [
-        {
-          "afi": "ipv4",
-          "interfaceName": "r4-eth0",
-          "ip": "10.0.21.2"
-        }
-      ],
-      "prefix": "10.0.21.0/24",
-      "protocol": "isis"
-    },
     {
       "nexthops": [
         {