Commit Graph

30591 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
cf2a2762b8
Merge pull request #12179 from LabNConsulting/working/lb/p2mp-improvements
ospf: optimization for FRR's P2MP mode
2022-10-26 22:46:10 -05:00
Ryoga Saito
5b786189bc bgpd: Fix the condition whether nexthop is changed
Given that the following topology, route server MUST not modify NEXT_HOP
attribute because route server isn't in the actual routing path. This
behavior is required to comply RFC7947

(Router A) <-(eBGP peer)-> (Route Server) <-(eBGP peer)-> (Router B)

RFC7947 says as follows:

> As the route server does not participate in the actual routing of
> traffic, the NEXT_HOP attribute MUST be passed unmodified to the route
> server clients, similar to the "third-party" next-hop
> feature described in Section 5.1.3. of [RFC4271].

However, current FRR is violating RFC7947 in some cases. If routers and
route server established BGP peer over IPv6 connection and routers
advertise ipv4-vpn routes through route server, route server will modify
NEXT_HOP attribute in these advertisements.

This is because the condition to check whether NEXT_HOP attribute should
be changed or not is wrong. We should use (afi, safi) as the key to
check, but (nhafi, safi) is actually used. This causes the RFC7947
violation.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-10-27 10:38:05 +09:00
Trey Aspelund
8c4d4624d2 bgpd: Check for IP-format Site-of-Origin
When deciding whether to apply "neighbor soo" filtering towards a peer,
we were only looking for SoO ecoms that use either AS or AS4 encoding.
This makes sure we also check for IPv4 encoding, since we allow a user
to configure that encoding style against the peer.

Config:
```
router bgp 1
 address-family ipv4 unicast
  network 100.64.0.2/32 route-map soo-foo
  neighbor 192.168.122.12 soo 3.3.3.3:20
 exit-address-family
!
route-map soo-foo permit 10
 set extcommunity soo 3.3.3.3:20
exit
```

Before:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i
*> 100.64.0.2/32    0.0.0.0                  0    100  32768 i

Total number of prefixes 2
```

After:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i

Total number of prefixes 1
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-10-26 21:09:55 +00:00
Donald Sharp
8d4665aabf zebra: Fix handling of recursive routes when processing closely in time
When zebra receives routes from upper level protocols it decodes the
zapi message and places the routes on the metaQ for processing.  Suppose
we have a route A that is already installed by some routing protocol.
And there is a route B that has a nexthop that will be recursively
resolved through A.  Imagine if a route replace operation for A is
going to happen from an upper level protocol at about the same time
the route B is going to be installed into zebra.  If these routes
are received, and decoded, at about the same time there exists a
chance that the metaQ will contain both of them at the same time.
If the order of installation is [ B, A ].  B will be resolved
correctly through A and installed, A will be processed and
re-installed into the FIB.  If the nexthops have changed for
A then the owner of B should be notified about the change( and B
can do the correct action here and decide to withdraw or re-install ).
Now imagine if the order of routes received for processing on the
metaQ is [ A, B ].  A will be received, processed and sent to the
dataplane for reinstall.  B will then be pulled off the metaQ and
fail the install since A is in a `not Installed` state.

Let's loosen the restriction in nexthop resolution for B such
that if the route we are dependent on is a route replace operation
allow the resolution to suceed.  This requires zebra to track a new
route state( ROUTE_ENTRY_ROUTE_REPLACING ) that can be looked at
during nexthop resolution.  I believe this is ok because A is
a route replace operation, which could result in this:
-route install failed, in which case B should be nht'ing and
will receive the nht failure and the upper level protocol should
remove B.
-route install succeeded, no nexthop changes.  In this case
allowing the resolution for B is ok, NHT will not notify the upper
level protocol so no action is needed.
-route install succeeded, nexthops changes.  In this case
allowing the resolution for B is ok, NHT will notify the upper
level protocol and it can decide to reinstall B or not based
upon it's own algorithm.

This set of events was found by the bgp_distance_change topotest(s).
Effectively the tests were looking for the bug ( A, B order in the metaQ )
as the `correct` state.  When under very heavy load, the A, B ordering
caused A to just be installed and fully resolved in the dataplane before
B is gotten to( which is entirely possible ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-26 15:06:23 -04:00
Stephen Worley
e185a2a956 bgpd: make the input-queue log more understandable
Make the input-queue log a bit more understandble to a person
debugging an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-26 13:23:21 -04:00
David Lamparter
3727be24a0 build: exclude a few more things from frr.xref
... this might need some better approach long-term.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
3dd40da369 python: fix for old (< 3.6) Python versions
Sigh.  No type annotations, no f-strings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
b053254ecc build: fix gRPC build dependencies
The generated header files need a dependency on the generated .c file,
otherwise build breaks when the header is used before it is generated.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
903ad92ca4 isisd/fabricd: use PROTO_NAME in SR code
The IS-IS SR code was missing a use of `PROTO_NAME`, making fabricd
collide with the isisd CLI command.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
e53dac2fb3 ospfd, ospf6d: align CLI help strings
ospfd and ospf6d define the same metric-type route-map commands.  Make
them have the same help string too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
89cb86aeb0 build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.

This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.

Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
Russ White
659800f3c1
Merge pull request #12199 from tewok/frr-routes-table-columns
bgpd: fixed misaligned columns in BGP routes table
2022-10-26 09:48:41 -04:00
anlan_cs
6c3aae9c56 ospfd: fix missing max-metric in show running config
```
(ospf)  max-metric router-lsa administrative
```

Currently this running config depends at least one `area` with *active*
`network`, otherwise it will not occur.

The check on this dependency is redundant and wrong, just remove it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-10-26 08:50:17 -04:00
Donald Sharp
b6ce3356d9 ospf6d: Make ospf6d happy with clang-16
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-26 07:41:03 -04:00
Donald Sharp
3ca6d7300b ldpd: Make ldpd happy with clang-16
Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2022-10-26 07:40:48 -04:00
Donald Sharp
00fb4b9dcd pimd: Make pimd happy with clang-16
Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2022-10-26 07:39:47 -04:00
Donald Sharp
d038abcc25 pathd: Make pathd happy with clang-16
Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2022-10-26 07:39:14 -04:00
Donatas Abraitis
97a52c82a5 bgpd: Implement Accumulated IGP Metric Attribute for BGP
https://www.rfc-editor.org/rfc/rfc7311.html

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-26 11:26:57 +03:00
Donatas Abraitis
91e9aee087 doc: Add documentation for AIGP
bgp bestpath aigp
neighbor PEER aigp

route-map X permit 10
 set aigp-metric <igp-metric|VALUE>

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-26 11:26:56 +03:00
Donatas Abraitis
0c969118c7 lib: Add ptr_get_be64() function
Get a single uint64_t value from two uint32_t values.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-26 11:22:43 +03:00
Sarita Patra
43a18948d5 pimd, pim6d: Fix rp-info OIF having PIM disabled interface
Problem:
frr(config)# show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

frr(config)# int ens192
frr(config-if)# no ip pim

frr(config) show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

rp-info OIF is still having ens192 which is PIM disabled.
Fixing this as part of this PR.

Issue: #12044

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-25 21:25:23 -07:00
Donald Sharp
103372fd75 isisd: Make clang-16 compiler happy with isisd
Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2022-10-25 20:06:49 -04:00
Donald Sharp
2816045a6e pceplib: Fix clang-16 not happy with build
In this case it was functions without a prototype

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2022-10-25 20:04:43 -04:00
Russ White
5f37d597e8
Merge pull request #12166 from anlancs/fix/bgpd-wildcard
bgpd: return failure for wildcard ERT
2022-10-25 11:34:38 -04:00
Lou Berger
c706f0e32b ospf: optimization for FRR's P2MP mode
FRR implements a non-standard, but compatible approach for
	sending update LSAs (it always send to 224.0.0.5) on P2MP
	interfaces. This change makes it so acks are also sent to
	224.0.0.5.

	Since the acks are multicast, this allows an optimization
	where we don't send back out the incoming P2MP interface
	immediately allow time to rx multicast ack from neighbors
	on the same net that rx'ed the original (multicast) update.

Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-25 15:31:44 +00:00
Lou Berger
675ba67d89 topotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info
Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-25 15:31:40 +00:00
Russ White
bcc6ffbd7b
Merge pull request #12187 from mjstapp/mjs_fix_bgp_allowas
bgpd: fix unconfig of allowas_in; add to show output
2022-10-25 11:26:06 -04:00
mobash-rasool
12b689e359
Merge pull request #12184 from nberlee/master
vtysh: Ensure an empty string does not get printed for host/domain
2022-10-25 20:53:50 +05:30
Wayne Morrison
eaeba5e868 bgpd: fixed misaligned columns in BGP routes table
Column headers in BGP routes table are not aligned with data when
RPKI status is available.  This was fixed to insert a space at the
beginning of the header and at the beginning of lines that do not
have RPKI status.

This fix requires that several testing templates be adjusted to
match the new output.

Signed-off-by: Wayne Morrison <wmorrison@netgate.com>
2022-10-25 10:45:35 -04:00
Russ White
96a499d027
Merge pull request #12069 from opensourcerouting/fix/local-as_reset
bgpd: Reuse flag action for reseting session for `neighbor PEER local-as`
2022-10-25 09:50:24 -04:00
Russ White
b19cb23104
Merge pull request #12142 from opensourcerouting/fix/sendholdtimer
bgpd: Honor default holdtime when triggering session reset for SendHoldTimer
2022-10-25 09:46:48 -04:00
Olivier Dugeon
c3a02dde41
Merge pull request #12151 from louis-6wind/fix-mpls-te
isisd: fixes for mpls-te
2022-10-25 13:51:24 +02:00
Olivier Dugeon
f274c9fde2
Merge pull request #12125 from louis-6wind/fix-link-params
lib,zebra,ospf: link-params are not flushed after "no enable"
2022-10-25 10:53:23 +02:00
Manoj Naragund
0022611fb7 ospf6d: Fix for memory leak issues in ospf6.
Problem:
Multiple memory leaks in ospf6.

 260 ==6637== 32 bytes in 1 blocks are definitely lost in loss record 5 of 24
 261 ==6637==    at 0x4C31FAC: calloc (vg_replace_malloc.c:762)
 262 ==6637==    by 0x4E8A1BF: qcalloc (memory.c:111)
 263 ==6637==    by 0x11EE27: ospf6_summary_add_aggr_route_and_blackhole (ospf6_asbr.c:2779)
 264 ==6637==    by 0x11EEBA: ospf6_originate_new_aggr_lsa (ospf6_asbr.c:2811)
 265 ==6637==    by 0x4E7C6A7: hash_clean (hash.c:325)
 266 ==6637==    by 0x11FA93: ospf6_handle_external_aggr_update (ospf6_asbr.c:3164)
 267 ==6637==    by 0x11FA93: ospf6_asbr_summary_process (ospf6_asbr.c:3386)
 268 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 269 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 270 ==6637==    by 0x119535: main (ospf6_main.c:228)

 356 ==6637== 240 bytes in 12 blocks are indirectly lost in loss record 13 of 24
 357 ==6637==    at 0x4C2FE96: malloc (vg_replace_malloc.c:309)
 358 ==6637==    by 0x4E8A0DA: qmalloc (memory.c:106)
 359 ==6637==    by 0x13545C: ospf6_lsa_alloc (ospf6_lsa.c:724)
 360 ==6637==    by 0x1354E3: ospf6_lsa_create_headeronly (ospf6_lsa.c:756)
 361 ==6637==    by 0x1355F2: ospf6_lsa_copy (ospf6_lsa.c:790)
 362 ==6637==    by 0x13B58B: ospf6_dbdesc_recv_slave (ospf6_message.c:976)
 363 ==6637==    by 0x13B58B: ospf6_dbdesc_recv (ospf6_message.c:1038)
 364 ==6637==    by 0x13B58B: ospf6_read_helper (ospf6_message.c:1838)
 365 ==6637==    by 0x13B58B: ospf6_receive (ospf6_message.c:1875)
 366 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 367 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 368 ==6637==    by 0x119535: main (ospf6_main.c:228)

RCA:
1. when the ospf6 area is being deleted, the neighbor related information
   was not being cleaned up.
2. when aggr route gets deleted from rt_aggr_tbl the corrsponding summary
   route attched to the aggr route was not being deleted.

Fix:
Added the ospf6_neighbor_delete in ospf6_area_delete to free the
neighbor related information and added ospf6_route_delete while
freeing external aggr route to free the summary route.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-10-25 00:43:10 -07:00
Nico Berlee
36d223bb6b
vtysh: Ensure an empty string does not get printed for host/domain
vtysh show running-config is showing:
frr version 8.3.1_git
frr defaults traditional
hostname test
log file /etc/frr/frr.log informational
log timestamp precision 3
domainname
service integrated-vtysh-config

domainname should not be printed in this case at all. If the
host has no search/domainname configured, frr_reload.py
crashes on invalid config from `vtysh show running-config`

Basically the same change as commit a7141b8

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
2022-10-25 07:40:01 +02:00
Stephen Worley
847ee2bb2e bgpd: checkpatch fixes in bgp_io code
Some checkpatch fixes for comments in the bgp_io code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-24 18:25:56 -04:00
Stephen Worley
a0b937de42 bgpd,doc: limit InQ buf to allow for back pressure
Add a default limit to the InQ for messages off the bgp peer
socket. Make the limit configurable via cli.

Adding in this limit causes the messages to be retained in the tcp
socket and allow for tcp back pressure and congestion control to kick
in.

Before this change, we allow the InQ to grow indefinitely just taking
messages off the socket and adding them to the fifo queue, never letting
the kernel know we need to slow down. We were seeing under high loads of
messages and large perf-heavy routemaps (regex matching) this queue
would cause a memory spike and BGP would get OOM killed. Modifying this
leaves the messages in the socket and distributes that load where it
should be in the socket buffers on both send/recv while we handle the
mesages.

Also, changes were made to allow the ringbuffer to hold messages and
continue to be filled by the IO pthread while we wait for the Main
pthread to handle the work on the InQ.

Memory spike seen with large numbers of routes flapping and route-maps
with dozens of regex matching:

```
Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  > 2GB
  Holding block headers: 516 KiB
  Used small blocks:     0 bytes
  Used ordinary blocks:  160 MiB
  Free small blocks:     3680 bytes
  Free ordinary blocks:  > 2GB
  Ordinary blocks:       121244
  Small blocks:          83
  Holding blocks:        1
```

With most of it being held by the inQ (seen from the stream datastructure info here):

```
Type                          : Current#   Size       Total     Max#  MaxBytes
...
...
Stream                        :   115543 variable  26963208 15970740 3571708768
```

With this change that memory is capped and load is left in the sockets:

RECV Side:
```
State    Recv-Q    Send-Q                           Local Address:Port                         Peer Address:Port    Process
ESTAB    265350    0            [fe80::4080:30ff:feb0:cee3]%veth1:36950         [fe80::4c14:9cff:fe1d:5bfd]:179      users:(("bgpd",pid=1393334,fd=26))
         skmem:(r403688,rb425984,t0,tb425984,f1816,w0,o0,bl0,d61)

```

SEND Side:
```
State  Recv-Q  Send-Q                        Local Address:Port                  Peer Address:Port   Process
ESTAB  0       1275012   [fe80::4c14:9cff:fe1d:5bfd]%veth1:179    [fe80::4080:30ff:feb0:cee3]:36950   users:(("bgpd",pid=1393443,fd=27))
         skmem:(r0,rb131072,t0,tb1453568,f1916,w1300612,o0,bl0,d0)

```

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-24 18:23:29 -04:00
Mark Stapp
b2ac1d0d4f bgpd: fix config of allowas_in; add to show output
Ensure that un-configuring allowas-in for a peer or group
clears the related flags and integer value. Tighten the use
of the integer counter so that it's only used when the config
flag is set. Add show output if allowas-in is enabled.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-10-24 12:50:17 -04:00
Donatas Abraitis
695f387ed8
Merge pull request #11673 from cscarpitta/srv6-per-vrf-sid
bgpd: add support for SRv6 L3VPN for IPv4 and IPv6 address families using a single SID
2022-10-24 17:30:10 +03:00
Louis Scalbert
acc0029779 isisd: fix potential access to NULL pointer in isis_route_update
Fix potential access to NULL pointer in isis_route_update even if it is
not related with the fast-reroute implementation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
1d5185eccb topotests: isis-lfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt1 and rt2
- The no link-detect setting on rt1 eth-rt2 is still present so that
  zebra does not take account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for BFD to comes down

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
3a03bf9f50 topotests: isis-lfa add a switchover test after neighbor clear
Add a switchover test that consists in clearing the rt2 neighbor on rt1.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
e87245d038 topotests: isis-lfa add a switchover test after hello timeout
Add a switchover test that consists in:
- Setting no link-detect on rt1 eth-rt2 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for the hello timer expiration

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
f4d0de1072 topotests: isis-lfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
fcb8ca9a88 isisd: fix SPF scheduling on IPv6 only topology
If ISIS is running on an IPv6 only topology, the command "spf interval"
has no effect.

Only the IPv4 SPF tree timers are taken into account.

Base the next SPF scheduling on the last running SPF tree.

Fixes: be985ba059 ("isisd: make use of advanced concepts like arrays and loops")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
a90d4c45db 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>
2022-10-24 14:56:42 +02:00
Louis Scalbert
2a9f5928fe topotests: isis-tilfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt5 and rt6
- Setting no link-detect on rt6 eth-rt5 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt6 eth-rt5 from the switch side

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
anlan_cs
7231b9ab17 bgpd: return failure for wildcard ERT
The "RTLIST..." list should be maintained integrity. If wildcard check
failed, it should immediately return failure. Otherwise user configuration
will be partial.

```
anlan(config-router-af)# route-target export *:55 33:33
% Wildcard '*' only applicable for import
anlan(config-router-af)# route-target both *:55 33:33
% Wildcard '*' only applicable for import
```

With this commit, the RTs without wildcard will not be executed as before. And
the same for `no` form.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-10-24 08:51:12 -04:00
Louis Scalbert
ca94e8d3a2 isisd: fix recreating the LS TED after re-enabling MPLS TE
When disabling and re-enabling the "mpls-te on" command, the LS TED
database is deleted but not re-created.

Cleanup the LS TED database instead of deleting it when disabling
"mpls-te".

Fixes: 1fa6385040.. ("isisd: Correct Valgrind errors")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 13:48:49 +02:00
Louis Scalbert
78d905be54 isisd: fix sending remote interface ip address after enabling MPLS TE
If MPLS TE is enabled, the router encodes the local and remote interface
IP address in the "Extended Reachability" TLV.

> east-vm(config)# do show isis database detail east-vm.00-00
>  Extended Reachability: 0007.e901.3333.00 (Metric: 10)
>    Local Interface IP Address(es): 10.126.0.2
>    Remote Interface IP Address(es): 10.126.0.3
>    Maximum Bandwidth: 1.76258e+08 (Bytes/sec)

The remote interface is added when the circuit adjacency comes up after
setting MPLS TE. However, if MPLS TE is enabled after, the remote
address is not added. It happens after disabling and re-enabling the
MPLS TE.

> east-vm(config)# router isis 1
> east-vm(config-router)# no mpls on
> east-vm(config-router)# mpls on
> east-vm(config)# do show isis database detail east-vm.00-00
>  Extended Reachability: 0007.e901.3333.00 (Metric: 10)
>    Local Interface IP Address(es): 10.126.0.2
>    Maximum Bandwidth: 1.76258e+08 (Bytes/sec)

Update the remote IPv4 and IPv6 of all adjacencies after enabling MPLS
TE.

Fixes: 1b3f47d04c ("isisd: Update TLVs processing for TE, RI & SR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 13:48:33 +02:00