]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: handle corner case involving TI-LFA and the SR No-PHP flag 8164/head
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 26 Feb 2021 16:39:02 +0000 (13:39 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 26 Feb 2021 18:54:01 +0000 (15:54 -0300)
When the last SID in the TI-LFA repair list is an Adj-SID from the
penultimate hop router towards the final hop, the No-PHP flag of the
original Prefix-SID must be honored in the repair list itself since
the penultimate hop router won't have a chance to process that SID
and pop it if necessary.

Reported-by: Fredi Raspall <fredi@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd/isis_lfa.c
tests/isisd/test_isis_spf.refout

index 2d1652b20705209ab1cc52e83c2855c6159cbf00..3ebac8aaa91b31447f37dc0e756766daa727ccc7 100644 (file)
@@ -669,6 +669,21 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc,
        if ((!is_qnode
             || spftree_pc->lfa.protected_resource.type == LFA_NODE_PROTECTION)
            && vertex_child) {
+               /*
+                * If vertex is the penultimate hop router, then pushing an
+                * Adj-SID towards the final hop means that the No-PHP flag of
+                * the original Prefix-SID must be honored. We do that by
+                * removing the previously added Prefix-SID from the repair list
+                * when those conditions are met.
+                */
+               if (vertex->depth == (vertex_dest->depth - 2)
+                   && VTYPE_IP(vertex_dest->type)
+                   && vertex_dest->N.ip.sr.present
+                   && !CHECK_FLAG(vertex_dest->N.ip.sr.sid.flags,
+                                  ISIS_PREFIX_SID_NO_PHP)) {
+                       list_delete_all_node(repair_list);
+               }
+
                label_qnode = tilfa_find_qnode_adj_sid(spftree_pc, vertex->N.id,
                                                       vertex_child->N.id);
                if (label_qnode == MPLS_INVALID_LABEL) {
index 024f7256e0bd61df7daa32337d5625a08d7b629e..bdd5b2e439a253a32ba27a993e7f49b41ed78f15 100644 (file)
@@ -3146,9 +3146,9 @@ rt3                  TE-IS        50     rt5                  -         rt5(4)
 \r
 IS-IS L1 IPv4 routing table:\r
 \r
- Prefix         Metric  Interface  Nexthop  Label(s)        \r
- -----------------------------------------------------------\r
- 10.0.255.3/32  60      -          rt5      16050/18/16030  \r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.3/32  60      -          rt5      16050/18  \r
 \r
 P-space (self):\r
  rt2\r
@@ -3194,9 +3194,9 @@ rt3                  TE-IS        50     rt5                  -         rt5(4)
 \r
 IS-IS L1 IPv6 routing table:\r
 \r
- Prefix           Metric  Interface  Nexthop  Label(s)        \r
- -------------------------------------------------------------\r
- 2001:db8::3/128  60      -          rt5      16051/19/16031  \r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::3/128  60      -          rt5      16051/19  \r
 \r
 test# test isis topology 2 root rt1 ti-lfa system-id rt1 pseudonode-id 1\r
 P-space (self):\r
@@ -3236,7 +3236,7 @@ IS-IS L1 IPv4 routing table:
 \r
  Prefix         Metric  Interface  Nexthop  Label(s)        \r
  -----------------------------------------------------------\r
- 10.0.255.4/32  65      -          rt2      16020/18/16040  \r
+ 10.0.255.4/32  65      -          rt2      16020/18        \r
  10.0.255.5/32  75      -          rt2      16020/18/16050  \r
  10.0.255.6/32  75      -          rt2      16020/18/16060  \r
 \r
@@ -3277,7 +3277,7 @@ IS-IS L1 IPv6 routing table:
 \r
  Prefix           Metric  Interface  Nexthop  Label(s)        \r
  -------------------------------------------------------------\r
- 2001:db8::4/128  65      -          rt2      16021/19/16041  \r
+ 2001:db8::4/128  65      -          rt2      16021/19        \r
  2001:db8::5/128  75      -          rt2      16021/19/16051  \r
  2001:db8::6/128  75      -          rt2      16021/19/16061  \r
 \r
@@ -3508,7 +3508,7 @@ IS-IS L1 IPv4 routing table:
  -----------------------------------------------------------\r
  10.0.255.2/32  100     -          rt3      16050/17/16020  \r
  10.0.255.4/32  90      -          rt3      16050/17/16040  \r
- 10.0.255.6/32  80      -          rt3      16050/17/16060  \r
+ 10.0.255.6/32  80      -          rt3      16050/17        \r
  10.0.255.8/32  90      -          rt3      16050/17/16080  \r
 \r
 test# test isis topology 4 root rt4 ti-lfa system-id rt6 ipv4-only\r
@@ -3553,7 +3553,7 @@ IS-IS L1 IPv4 routing table:
 \r
  Prefix         Metric  Interface  Nexthop  Label(s)        \r
  -----------------------------------------------------------\r
- 10.0.255.6/32  100     -          rt2      16050/17/16060  \r
+ 10.0.255.6/32  100     -          rt2      16050/17        \r
  10.0.255.8/32  110     -          rt2      16050/17/16080  \r
 \r
 test# test isis topology 5 root rt1 ti-lfa system-id rt2 ipv4-only\r
@@ -3865,7 +3865,7 @@ IS-IS L1 IPv4 routing table:
  10.0.255.1/32   100     -          rt5      16110/17/16010  \r
  10.0.255.4/32   90      -          rt5      16110/17/16040  \r
  10.0.255.7/32   80      -          rt5      16110/17/16070  \r
- 10.0.255.10/32  70      -          rt5      16110/17/16100  \r
+ 10.0.255.10/32  70      -          rt5      16110/17        \r
 \r
 test# test isis topology 8 root rt2 ti-lfa system-id rt5 ipv4-only\r
 P-space (self):\r
@@ -3979,9 +3979,9 @@ rt3                  TE-IS        120    rt2                  -         rt4(4)
 \r
 IS-IS L1 IPv4 routing table:\r
 \r
- Prefix         Metric  Interface  Nexthop  Label(s)        \r
- -----------------------------------------------------------\r
- 10.0.255.3/32  130     -          rt2      16040/18/16030  \r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.3/32  130     -          rt2      16040/18  \r
 \r
 P-space (self):\r
  rt2\r
@@ -4030,9 +4030,9 @@ rt3                  TE-IS        120    rt2                  -         rt4(4)
 \r
 IS-IS L1 IPv6 routing table:\r
 \r
- Prefix           Metric  Interface  Nexthop  Label(s)        \r
- -------------------------------------------------------------\r
- 2001:db8::3/128  130     -          rt2      16041/19/16031  \r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::3/128  130     -          rt2      16041/19  \r
 \r
 test# test isis topology 9 root rt1 ti-lfa system-id rt2\r
 P-space (self):\r
@@ -4079,7 +4079,7 @@ IS-IS L1 IPv4 routing table:
  Prefix         Metric  Interface  Nexthop  Label(s)        \r
  -----------------------------------------------------------\r
  10.0.255.2/32  130     -          rt3      16030/18/16020  \r
- 10.0.255.4/32  120     -          rt3      16030/18/16040  \r
+ 10.0.255.4/32  120     -          rt3      16030/18        \r
  10.0.255.5/32  130     -          rt3      16030/18/16050  \r
  10.0.255.6/32  150     -          rt3      16030/18/16060  \r
  10.0.255.7/32  150     -          rt3      16030/18/16070  \r
@@ -4130,7 +4130,7 @@ IS-IS L1 IPv6 routing table:
  Prefix           Metric  Interface  Nexthop  Label(s)        \r
  -------------------------------------------------------------\r
  2001:db8::2/128  130     -          rt3      16031/19/16021  \r
- 2001:db8::4/128  120     -          rt3      16031/19/16041  \r
+ 2001:db8::4/128  120     -          rt3      16031/19        \r
  2001:db8::5/128  130     -          rt3      16031/19/16051  \r
  2001:db8::6/128  150     -          rt3      16031/19/16061  \r
  2001:db8::7/128  150     -          rt3      16031/19/16071  \r
@@ -4213,9 +4213,9 @@ IS-IS L1 IPv4 routing table:
  10.0.255.3/32  80      -          rt6      16060/16/16030  \r
                         -          rt7      16070/16/16030  \r
                         -          rt8      16080/16/16030  \r
- 10.0.255.4/32  50      -          rt6      16060/16/16040  \r
-                        -          rt7      16070/16/16040  \r
-                        -          rt8      16080/16/16040  \r
+ 10.0.255.4/32  50      -          rt6      16060/16        \r
+                        -          rt7      16070/16        \r
+                        -          rt8      16080/16        \r
  10.0.255.5/32  60      -          rt6      16060/16/16050  \r
                         -          rt7      16070/16/16050  \r
                         -          rt8      16080/16/16050  \r
@@ -4295,9 +4295,9 @@ IS-IS L1 IPv6 routing table:
  2001:db8::3/128  80      -          rt6      16061/17/16031  \r
                           -          rt7      16071/17/16031  \r
                           -          rt8      16081/17/16031  \r
- 2001:db8::4/128  50      -          rt6      16061/17/16041  \r
-                          -          rt7      16071/17/16041  \r
-                          -          rt8      16081/17/16041  \r
+ 2001:db8::4/128  50      -          rt6      16061/17        \r
+                          -          rt7      16071/17        \r
+                          -          rt8      16081/17        \r
  2001:db8::5/128  60      -          rt6      16061/17/16051  \r
                           -          rt7      16071/17/16051  \r
                           -          rt8      16081/17/16051  \r
@@ -4351,9 +4351,9 @@ rt3                  TE-IS        50     rt5                  -         rt1(4)
 \r
 IS-IS L1 IPv4 routing table:\r
 \r
- Prefix         Metric  Interface  Nexthop  Label(s)        \r
- -----------------------------------------------------------\r
- 10.0.255.8/32  60      -          rt5      16040/26/16080  \r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.8/32  60      -          rt5      16040/26  \r
 \r
 P-space (self):\r
  rt1\r
@@ -4403,9 +4403,9 @@ rt3                  TE-IS        50     rt5                  -         rt1(4)
 \r
 IS-IS L1 IPv6 routing table:\r
 \r
- Prefix           Metric  Interface  Nexthop  Label(s)        \r
- -------------------------------------------------------------\r
- 2001:db8::8/128  60      -          rt5      16041/27/16081  \r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::8/128  60      -          rt5      16041/27  \r
 \r
 test# test isis topology 10 root rt1 ti-lfa system-id rt2\r
 P-space (self):\r
@@ -4460,8 +4460,8 @@ IS-IS L1 IPv4 routing table:
                         -          rt4      16070/18/16020  \r
  10.0.255.5/32  100     -          rt3      20060/18/16050  \r
                         -          rt4      16070/18/16050  \r
- 10.0.255.8/32  90      -          rt3      20060/18/16080  \r
-                        -          rt4      16070/18/16080  \r
+ 10.0.255.8/32  90      -          rt3      20060/18        \r
+                        -          rt4      16070/18        \r
 \r
 P-space (self):\r
  rt3\r
@@ -4515,8 +4515,8 @@ IS-IS L1 IPv6 routing table:
                           -          rt4      16071/19/16021  \r
  2001:db8::5/128  100     -          rt3      20061/19/16051  \r
                           -          rt4      16071/19/16051  \r
- 2001:db8::8/128  90      -          rt3      20061/19/16081  \r
-                          -          rt4      16071/19/16081  \r
+ 2001:db8::8/128  90      -          rt3      20061/19        \r
+                          -          rt4      16071/19        \r
 \r
 test# test isis topology 10 root rt1 ti-lfa system-id rt4\r
 P-space (self):\r
@@ -4563,7 +4563,7 @@ IS-IS L1 IPv4 routing table:
  Prefix         Metric  Interface  Nexthop  Label(s)        \r
  -----------------------------------------------------------\r
  10.0.255.4/32  100     -          rt2      16080/20/16040  \r
- 10.0.255.7/32  90      -          rt2      16080/20/16070  \r
+ 10.0.255.7/32  90      -          rt2      16080/20        \r
 \r
 P-space (self):\r
  rt2\r
@@ -4609,7 +4609,7 @@ IS-IS L1 IPv6 routing table:
  Prefix           Metric  Interface  Nexthop  Label(s)        \r
  -------------------------------------------------------------\r
  2001:db8::4/128  100     -          rt2      16081/21/16041  \r
- 2001:db8::7/128  90      -          rt2      16081/21/16071  \r
+ 2001:db8::7/128  90      -          rt2      16081/21        \r
 \r
 test# test isis topology 11 root rt2 ti-lfa system-id rt4\r
 P-space (self):\r
@@ -4747,12 +4747,12 @@ rt3                  TE-IS        740    rt2                  -         rt5(4)
 \r
 IS-IS L1 IPv4 routing table:\r
 \r
- Prefix         Metric  Interface  Nexthop  Label(s)              \r
- -----------------------------------------------------------------\r
- 10.0.255.3/32  750     -          rt2      16080/17/16/16/16030  \r
- 10.0.255.5/32  350     -          rt2      16080/17/16/16050     \r
- 10.0.255.7/32  150     -          rt2      16080/17/16070        \r
- 10.0.255.9/32  160     -          rt2      16080/17/18/16090     \r
+ Prefix         Metric  Interface  Nexthop  Label(s)        \r
+ -----------------------------------------------------------\r
+ 10.0.255.3/32  750     -          rt2      16080/17/16/16  \r
+ 10.0.255.5/32  350     -          rt2      16080/17/16     \r
+ 10.0.255.7/32  150     -          rt2      16080/17        \r
+ 10.0.255.9/32  160     -          rt2      16080/17/18     \r
 \r
 test# test isis topology 13 root rt1 ti-lfa system-id rt3 ipv4-only\r
 P-space (self):\r