Renato Westphal [Fri, 20 Nov 2020 21:35:37 +0000 (18:35 -0300)]
tests: add IS-IS classic LFA unit tests
These unit tests check the basic LFA loop-free condition on a
variety of different network topologies. None of the implemented
LFA tie-breakers are tested here.
Renato Westphal [Tue, 24 Nov 2020 22:38:11 +0000 (19:38 -0300)]
isisd: store LSPs associated to all SPF adjacencies
Instead of storing the LSP associated to pseudonodes only, store the
LSP associated to all SPF adjacencies instead.
The upcoming LFA work will need to have that piece of information
for all SPF adjacencies in order to know which ones have the overload
bit set or not. Other use cases might arise in the future.
Renato Westphal [Fri, 20 Nov 2020 21:59:35 +0000 (18:59 -0300)]
isisd: rename the "debug isis ti-lfa" command to make it more generic
Rename "debug isis ti-lfa" to "debug isis lfa". Having different
debug guards for different kinds of LFA (classic, remote and TI-LFA)
doesn't make sense since all LFA solutions share code to certain
extent.
Renato Westphal [Sat, 14 Nov 2020 02:28:07 +0000 (23:28 -0300)]
isisd: move and rename the infinity metric constants
Those constants are also useful in contexts other than LDP-IGP
Synchronization (e.g. the upcoming LFA work will need them). Move
them to a more general header to reflect that.
Renato Westphal [Thu, 5 Nov 2020 13:52:14 +0000 (10:52 -0300)]
isisd: consult locally configured MSD when computing TI-LFA repair paths
Do not attempt to install a TI-LFA backup nexthop if its number of
labels exceeds the locally configured MSD (Maximum Stack Depth). The
idea is to prevent forward-plane installation failures before they
happen. The MSD check should also allow the "show isis fast-reroute
summary" command (not implemented yet) to display the actual
protection coverage provided by TI-LFA, which might not be 100%
if the MSD isn't big enough.
ckishimo [Fri, 20 Nov 2020 21:53:20 +0000 (13:53 -0800)]
ospfd: fix NSSA translate-always
When an ABR NSSA router is configured to be ALWAYS the translator:
r22(config-router)# area 1 nssa translate-always
It will advertise this condition in the type-1 LSA setting the Nt
bit, taking over the translator role from r33
r22# show ip ospf
We are an ABR and always an NSSA Translator.
r33# show ip ospf
We are an ABR, but not the NSSA Elected Translator.
However when the command above is removed:
r22(config-router)# no area 1 nssa translate-always
the bit Nt needs to be cleared otherwise we end up with no translator
in the area
r22# show ip ospf
We are an ABR, but not the NSSA Elected Translator.
r33# show ip ospf
We are an ABR, but not the NSSA Elected Translator.
This PR forces the ABR to send a type-1 LSA with the Nt bit updated
according to the translator role
Donald Sharp [Fri, 20 Nov 2020 13:00:08 +0000 (08:00 -0500)]
bgpd: Remove restriction on certain connection types under HAVE_CUMULUS
Current code when we are establishing a peering relationship when
under the HAVE_CUMULUS block will dissallow v4/v6 connections if
we do not have v4/v6 addresses applied. This restriction is
a bit harsh and should be allowed but warned against.
vdhingra [Thu, 19 Nov 2020 12:46:39 +0000 (04:46 -0800)]
bgpd: sh running config is not considering values provided via -e for max-paths
problem
1. run the bgp with -e1 option
2. c t
router bgp 100
3. show running config
!
address-family ipv6 multicast
maximum-paths 1
maximum-paths ibgp 1
exit-address-family
!
address families should not dump maximum-paths if there
value is same as value provided at run time.
fix
if the maxpaths_ebgp value is same as multipath_num global
object, don't dump maximum-paths.
Igor Ryzhov [Thu, 19 Nov 2020 21:41:50 +0000 (00:41 +0300)]
lib: fix local variable shadowing global one
start_config and end_config are already used as function names in DEFUN,
so the current naming is a little bit confusing. Let's use different
names for arguments.
Donald Sharp [Thu, 19 Nov 2020 13:04:51 +0000 (08:04 -0500)]
ospf6d: More lists being leaked
Apparently the person who wrote this code was big into
cut-n-paste. Commit 710a61d57c8f1b0ea66a37f09bad2161d7e2ddb7
found the first instance, but upon code inspection this morning
it became evident that 2 other functions had the exact same
problem.
Fix. Note I have not cleaned up the cut-n-paste code for
two reasons: a) I'm chasing something else b) this code
has been fairly un-maintained for a very long time. No
need to start up now.
Donald Sharp [Thu, 19 Nov 2020 12:40:03 +0000 (07:40 -0500)]
tests: Fix common_config.py issues
1) in generate_ips if start_ipaddr does not have a `/` in it
there exists a code path where both mask and step are
null values. Write a bit of code to ensure this pre-req
is found early and often
2) in verify_rib there exists a code path where static_route
is null when we get to the non static route section. Change
the code to operate on the advertise_network_dict that
we are iterating over.
ckishimo [Thu, 19 Nov 2020 07:23:14 +0000 (23:23 -0800)]
ospfd: fix NSSA translator
Having 2 ABR in NSSA area where R3 is the elected translator
R3# show ip ospf
We are an ABR and the NSSA Elected Translator.
R2# show ip ospf
We are an ABR, but not the NSSA Elected Translator.
When R3 loses the Border condition by shutting down the interface
to the backbone, we end up with no translator in the NSSA area. It
is expected R2 to take over the translator role
R3# sh ip ospf
It is not ABR, therefore not Translator.
R2# show ip ospf
We are an ABR, but not the NSSA Elected Translator.
This PR forces the ABR to reevaluate the translator condition, so
R2 becomes the elected Translator
Donald Sharp [Wed, 18 Nov 2020 16:04:27 +0000 (11:04 -0500)]
bgpd, lib, nhrpd, zebra: verify return of sockunion2hostprefix
The return from sockunion2hostprefix tells us if the conversion
succeeded or not. There are places in the code where we
always assume that it just `works`, since it can fail
notice and try to do the right thing.
Please note that failure of this function for most cases
of sockunion2hostprefix is highly highly unlikely as that
the sockunion was already created and tested elsewhere
it's just that this function can fail.
when deleting a whole l2vpn context in ldpd which also had pseudowires
in it, we were first deleting the l2vpn with a 'no l2vpn XXX' command,
and then adding it again by running 'l2vpn XXX\n no member pseudowire YYY'
which obviously was not needed. As a result the l2vpn would be reinstated.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Vincent Bernat [Tue, 17 Nov 2020 19:29:31 +0000 (20:29 +0100)]
bgpd: identify passive connections in JSON summary
When using non JSON output, passive connections are marked with:
BGP state = Active (passive)
However, such an information is not available in JSON output. This
commit adds that. It also adds "Active (NSF passive)" flag, like the
regular output.