]> git.puffer.fish Git - mirror/frr.git/commit
isisd: fix metric calculation of classic lfa backup prefixes
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 14 Apr 2022 13:32:17 +0000 (15:32 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Tue, 24 May 2022 08:06:05 +0000 (10:06 +0200)
commite45958e9cfccd6dfc108a7ef5cb73775e8ef2e68
tree9fcc9072645bcc8b91cea07948718fb6c4f810d2
parente83a52698b31fde2532b4a5a8c5223ba5e858ef2
isisd: fix metric calculation of classic lfa backup prefixes

The isis-lfa-topo1 topotest shows backup routes with lower metrics than
the primary ones.

> rt1# show isis route
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::1/128  0       -          -                          -
>  2001:db8:1000::2/128  20      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>  2001:db8:1000::3/128  20      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>  2001:db8:1000::4/128  20      eth-rt4    fe80::5ced:29ff:feed:59c4  -
> (...)
>
> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  15      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>                                eth-rt6    fe80::ac8c:dff:feac:8a8d   -
>  2001:db8:1000::3/128  15      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>  2001:db8:1000::4/128  45      eth-rt5    fe80::847d:feff:fe74:bdde  -
> (...)

Backup routes metrics are incorrect because they only take into account
the path metric but not the prefix metric.

Add the prefix metric to the path metric on backup routes.

After the patch with a prefix metric of 10:

> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  25      eth-rt3    fe80::8c6f:8aff:fe10:ad0d  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>                                eth-rt6    fe80::4810:47ff:fe81:2b9a  -
>  2001:db8:1000::3/128  25      eth-rt2    fe80::e855:12ff:fe31:5765  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>  2001:db8:1000::4/128  55      eth-rt5    fe80::b08e:5cff:fe90:62dd  -

Fixes: e886416f81 ("isisd: add support for classic LFA (RFC 5286)")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
isisd/isis_lfa.c
tests/isisd/test_isis_spf.refout