Commit Graph

29152 Commits

Author SHA1 Message Date
Donatas Abraitis
0ac7452334 bgpd: Adjust symbolic names for cease notifications according to rfc4486
The following subcodes are defined for the Cease NOTIFICATION
   message:

      Subcode     Symbolic Name

         1        Maximum Number of Prefixes Reached
         2        Administrative Shutdown
         3        Peer De-configured
         4        Administrative Reset
         5        Connection Rejected
         6        Other Configuration Change
         7        Connection Collision Resolution
         8        Out of Resources

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-06 10:07:41 +02:00
Christian Hopps
d76a3c5165
Merge pull request #10294 from opensourcerouting/topotests-nhrp-require-5.0
topotests: require Linux 5.0 for NHRP
2022-01-05 22:25:07 -05:00
David Lamparter
fbfdb4f23a topotests: require Linux 5.0 for NHRP
It fails on 4.19, so let's go minimum 5.0 for the time being.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-05 21:00:40 +01:00
ckishimo
35ee59fb57 ospf6d: stop refreshing type-5 from NSSA
With the current code, in a topology like this:
         r1 ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3(ASBR)
                                             NSSA

where r3 is redistributing statics within the NSSA area, the ABR (r2)
is translating type-7 lsa to type-5.

Everytime the function ospf6_abr_nssa_task() is executed all translated
type-5 are aged out and refreshed for no reason. So for instance having 3
lsas already advertised:

r1# sh ipv6 os database
        AS Scoped Link State Database
Type LSId           AdvRouter       Age   SeqNum                        Payload
ASE  0.0.0.1        2.2.2.2          39 80000001                     3:3::3/128
ASE  0.0.0.2        2.2.2.2          39 80000001                     4:4::4/128
ASE  0.0.0.3        2.2.2.2          39 80000001                     5:5::5/128

Adversting a new route from r3:

r3(config)# ipv6 route 6:6::6/128 Null0

r1# sh ipv6 os database
        AS Scoped Link State Database
Type LSId           AdvRouter       Age   SeqNum                        Payload
ASE  0.0.0.1        2.2.2.2         124 80000001                     3:3::3/128
ASE  0.0.0.2        2.2.2.2         124 80000001                     4:4::4/128
ASE  0.0.0.3        2.2.2.2         124 80000001                     5:5::5/128
ASE  0.0.0.4        2.2.2.2           8 80000001                     6:6::6/128

That seems okay, however a few seconds later we see all prefixes refreshed

r1# sh ipv6 os database
        AS Scoped Link State Database
Type LSId           AdvRouter       Age   SeqNum                        Payload
ASE  0.0.0.1        2.2.2.2        3600 80000001                     3:3::3/128
ASE  0.0.0.2        2.2.2.2        3600 80000001                     4:4::4/128
ASE  0.0.0.3        2.2.2.2        3600 80000001                     5:5::5/128
ASE  0.0.0.4        2.2.2.2        3600 80000001                     6:6::6/128
ASE  0.0.0.5        2.2.2.2           3 80000001                     3:3::3/128
ASE  0.0.0.6        2.2.2.2           3 80000001                     4:4::4/128
ASE  0.0.0.7        2.2.2.2           3 80000001                     5:5::5/128
ASE  0.0.0.8        2.2.2.2           3 80000001                     6:6::6/128

This PR prevents the LSA of being refreshed by unsetting the OSPF6_LSA_UNAPPROVED
flag so advertising the last prefix will not refresh all of them:

r1# sh ipv6 os database
        AS Scoped Link State Database
Type LSId           AdvRouter       Age   SeqNum                        Payload
ASE  0.0.0.1        2.2.2.2          90 80000001                     3:3::3/128
ASE  0.0.0.2        2.2.2.2          47 80000001                     4:4::4/128
ASE  0.0.0.3        2.2.2.2          35 80000001                     5:5::5/128
ASE  0.0.0.4        2.2.2.2           7 80000001                     6:6::6/128

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-05 18:19:32 +01:00
Mark Stapp
fd23ce2c01 docs: clarify topotest requirements
The developer docs weren't clear about some pre-reqs.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-01-05 10:27:17 -05:00
Russ White
cd764511e6
Merge pull request #10208 from adrianomarto/master
Babel configuration parameter fixes
2022-01-05 10:10:23 -05:00
Russ White
d962e875fe
Merge pull request #10260 from ton31337/feature/bgp_llgr_helper_mode
bgpd: Implement LLGR helper mode
2022-01-05 10:08:31 -05:00
Stephen Worley
3728cc8e12 docker: update alpine build enable set own version
Add ability to set your own env for the version of the docker
container alpine image. This is useful for applications like GNS3
who pin a specific version to look for when they boot up. When you build
locally to test your code you can just set the version to 0 so you don't
have to update configs/scripts looking for a specific image version.

Also fix a shebang in docker start for alpine.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-01-04 13:14:51 -05:00
Donald Sharp
3f6548c542
Merge pull request #10274 from anlancs/fix-spell-error-bfd
bfdd: correct one spelling error of comment
2022-01-02 17:57:46 -05:00
anlan_cs
5498a9f13d bfdd: correct one spelling error of comment
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-31 05:32:49 -05:00
anlan_cs
9dee14bdb8 tools: cleanup route convertion from null0/Null0 to blackhole
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-31 00:59:22 -05:00
Russ White
074ad7cb59
Merge pull request #10219 from donaldsharp/l3vpn_to_bgp_vrf_fixes
tests: Further fix bgp_l3vpn_to_bgp_vrf
2021-12-30 18:42:21 -05:00
Donatas Abraitis
dabca69ee7 tests: Add basic BGP Long-lived Graceful restart tests
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-28 16:35:57 +02:00
Donatas Abraitis
7f8a9a24a9 bgpd: Change default long-lived graceful restart stale timer to 0 seconds
That means the feature is off by default.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-28 16:08:00 +02:00
Donatas Abraitis
1479ed2fb3 bgpd: Implement LLGR helper mode
Tested between GoBGP and FRR (this commit).

```
┌───────────┐             ┌────────────┐
│           │             │            │
│ GoBGPD    │             │ FRRouting  │
│ (restart) │             │            │
│           │             │            │
└──────┬────┘             └───────┬────┘
       │                          │
       │                          │
       │                          │
       │     ┌───────────┐        │
       │     │           │        │
       │     │           │        │
       └─────┤ FRRouting ├────────┘
             │ (helper)  │
             │           │
             └───────────┘

// GoBGPD
% cat /etc/gobgp/config.toml
[global.config]
    as = 65002
    router-id = "2.2.2.2"
    port = 179

[[neighbors]]
    [neighbors.config]
        peer-as = 65001
        neighbor-address = "2a02🔤:123"
    [neighbors.graceful-restart.config]
        enabled = true
        restart-time = 3
        long-lived-enabled = true
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv6-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 10
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv4-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 20

% ./gobgp global rib add -a ipv6 2001:db8:4::/64
% ./gobgp global rib add -a ipv6 2001:db8:5::/64 community 65535:7
% ./gobgp global rib add -a ipv4 100.100.100.100/32
% ./gobgp global rib add -a ipv4 100.100.100.200/32 community 65535:7
```

1. When killing GoBGPD, graceful restart timer starts in FRR helper router;
2. When GR timer expires in helper router:
   a) LLGR_STALE community is attached to routes to be retained;
   b) Clear stale routes that have NO_LLGR community attached;
   c) Start LLGR timer per AFI/SAFI;
   d) Recompute bestpath and reannounce routes to peers;
   d) When LLGR timer expires, clear all routes on particular AFI/SAFI.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-28 16:07:59 +02:00
Donald Sharp
5086cc1c66
Merge pull request #10254 from ton31337/fix/typo
bgpd: Fix typo in bgp_aggr_community_hash_alloc()
2021-12-27 08:21:49 -05:00
Igor Ryzhov
5af4491693
Merge pull request #10261 from ton31337/fix/remove_if0 2021-12-24 01:09:41 +03:00
Donatas Abraitis
b7f0afa9a9
Merge pull request #10259 from anlancs/add-assert-ospf6
ospf6d: clean coverity warning of possible null pointer
2021-12-23 14:50:47 +02:00
Donatas Abraitis
f5827f3689 bgpd: Drop if 0 blocks
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-23 14:41:11 +02:00
Igor Ryzhov
63011ec1c5
Merge pull request #10256 from anlancs/cleanup-zebra_evpn_mac_add
zebra: cleanup checking zebra_evpn_mac_add function's return value
2021-12-23 13:10:18 +03:00
anlan_cs
e146082ddc ospf6d: clean coverity warning of possible null pointer
Add assert to protect it.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-22 21:52:30 -05:00
anlan_cs
07361b8fdf zebra: cleanup checking zebra_evpn_mac_add function's return value
This function is sure to return correct value by "assert", so the
checking its return value should be removed.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-22 21:13:26 -05:00
Adriano Marto Reis
ef473aa3e4 doc: Minor grammar correction
No comma needed.

Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
2021-12-23 07:32:33 +10:00
Adriano Marto Reis
896cf5c5f2 babeld: C-style comments
Replacing C++-style comments with C-style comments.

Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
2021-12-23 07:32:23 +10:00
Adriano Marto Reis
a665be6a88 doc: Updating babel default configuration parameters
Updating babel default configuration parameters rtt-min and
max-rtt-penalty according to the actual implementation.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2021-12-23 07:32:12 +10:00
Adriano Marto Reis
aa3ba071f6 babeld: Presenting interface configuration parameters
* Presenting the configuration parameters enable-timestamps,
max-rtt-penalty, rtt-min, and rtt-max.
* Using #defines for the default configuration values instead of magic
numbers.
* rtt-max and rtt-min are entered and presented in milliseconds, but
stored and internally used in microseconds.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2021-12-23 07:31:58 +10:00
Donatas Abraitis
1182f26489
Merge pull request #8494 from donaldsharp/wfi_failures
bgpd, tests: Add code to handle failed installations
2021-12-22 09:53:44 +02:00
Igor Ryzhov
688ad3f148
Merge pull request #10255 from qlyoung/fix-ldpd-doc-option-typo 2021-12-22 07:49:47 +03:00
Quentin Young
c039af97d9 doc: fix typo in ldpd docs
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-12-21 17:04:11 -05:00
Donatas Abraitis
69a211cb69 bgpd: Fix typo in bgp_aggr_community_hash_alloc()
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-21 21:18:17 +02:00
Igor Ryzhov
ac2cb9bf94 *: rework renaming the default VRF
Currently, it is possible to rename the default VRF either by passing
`-o` option to zebra or by creating a file in `/var/run/netns` and
binding it to `/proc/self/ns/net`.

In both cases, only zebra knows about the rename and other daemons learn
about it only after they connect to zebra. This is a problem, because
daemons may read their config before they connect to zebra. To handle
this rename after the config is read, we have some special code in every
single daemon, which is not very bad but not desirable in my opinion.
But things are getting worse when we need to handle this in northbound
layer as we have to manually rewrite the config nodes. This approach is
already hacky, but still works as every daemon handles its own NB
structures. But it is completely incompatible with the central
management daemon architecture we are aiming for, as mgmtd doesn't even
have a connection with zebra to learn from it. And it shouldn't have it,
because operational state changes should never affect configuration.

To solve the problem and simplify the code, I propose to expand the `-o`
option to all daemons. By using the startup option, we let daemons know
about the rename before they read their configs so we don't need any
special code to deal with it. There's an easy way to pass the option to
all daemons by using `frr_global_options` variable.

Unfortunately, the second way of renaming by creating a file in
`/var/run/netns` is incompatible with the new mgmtd architecture.
Theoretically, we could force daemons to read their configs only after
they connect to zebra, but it means adding even more code to handle a
very specific use-case. And anyway this won't work for mgmtd as it
doesn't have a connection with zebra. So I had to remove this option.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-21 22:09:29 +03:00
Quentin Young
a20b63bf64
Merge pull request #10216 from opensourcerouting/lib-assorted-20211214 2021-12-21 11:18:08 -05:00
Igor Ryzhov
8bf225ee15
Merge pull request #10228 from opensourcerouting/bgp-agg-aspath
bgpd: fix aggregate route AS Path attribute
2021-12-21 19:14:19 +03:00
Lou Berger
4b7d297d4b
Merge pull request #9750 from mjstapp/zebra_installed_nhg_id
zebra: add installed nexthop-group id value
2021-12-21 10:31:04 -05:00
Igor Ryzhov
0aabf8bf85
Merge pull request #10182 from mjstapp/fix_clang_break_opers
tools: clang-format break after operators
2021-12-21 18:23:00 +03:00
Rafael Zalamena
8bd0d3b1db bgpd: fix aggregate route AS Path attribute
Always free the locally allocated attribute not the one we are using for
return. This fixes a memory leak and a crash when AS Path is set with
route-map.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-12-21 10:48:18 -03:00
Donald Sharp
9d472a3581
Merge pull request #10098 from opensourcerouting/ospf-gr-topotest-fix
ospfd: fix incorrect detection of topology changes in helper mode
2021-12-21 08:43:32 -05:00
Igor Ryzhov
08583527b2
Merge pull request #10250 from ton31337/fix/no_need_to_test_for_BGP_TIMER_OFF
bgpd: No need to test if a thread is running for BGP_TIMER_OFF
2021-12-21 14:16:53 +03:00
Donatas Abraitis
22472feef8 bgpd: No need to test if a thread is running for BGP_TIMER_OFF
Handles that inside the macro.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-21 10:57:07 +02:00
Donatas Abraitis
20044d8090
Merge pull request #10245 from anlancs/fix-spell-error
zebra: correct one spell error
2021-12-20 15:14:53 +02:00
Igor Ryzhov
2593d35e0b
Merge pull request #10181 from ton31337/fix/default-originate_route-map
doc: Add `default-originate route-map WORD` for bgpd
2021-12-20 16:13:07 +03:00
Igor Ryzhov
947ecff5a7
Merge pull request #10236 from ffontaine/master
configure.ac: fix enable_bmp typo
2021-12-20 16:12:03 +03:00
anlan_cs
b816de6213 zebra: correct one spell error
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-19 20:47:01 -05:00
Donald Sharp
997acc8944
Merge pull request #10243 from Drumato/pathd-fix-typo
pathd: fix typo in pathd/path_ted.c
2021-12-19 20:14:56 -05:00
Yamato Sugawara
1e519577ab pathd: fix typo in pathd/path_ted.c
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2021-12-19 11:25:15 +00:00
Donald Sharp
be785e356a bgpd, tests: Add code to handle failed installations
Currently the Wait for Install code ( bgp_suppress_fib ) does
not properly handle two states from zebra:  ROUTE_INSTALL_FAILED
and BETTER_ADMIN_DISTANCE_WON.  Pre this change the WFI code
would just never notify our peers about a route install failure
but more is needed.  In the ROUTE_INSTALL_FAILED and the
BETTER_ADMIN_DISTANCE_WON we need to notify our peers with
a withdrawal about the route, else we will continue to
draw traffic to us when we cannot legally do so.

Why is this needed?  In either case imagine that we've already
received a bgp route, installed it and sent to our peers.
In the Better admin distance won case, say a static route is installed
at this point in time we must stop advertising the route through
us since we are not installed.  As such a withdrawal must be sent.

In the ROUTE_INSTALL_FAILED case, the code was not properly handling
the situation where we have Route A, it was successfully installed
and then we received a update to Route A that was attempted to be
installed but failed.  In this case we also need to send a withdrawal

Finally update the bgp_suppress_fib topotest to test both of these
situations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-17 13:28:56 -05:00
Fabrice Fontaine
bacabf2476 configure.ac: fix enable_bmp typo
enable_bmp doesn't exist, use enable_bgp_bmp

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-12-16 23:23:43 +01:00
Donatas Abraitis
a98380bb93
Merge pull request #10213 from idryzhov/isis-adj-uaf
isisd: fix use after free
2021-12-16 16:41:11 +02:00
Ryoga Saito
3d1ae061a3 bgpd: delete NULL assignment in bgp_attr_hash_alloc
If soft-reconfiguration is enabled, bgp_adj_in_set will be called
from bgp_update and bgp_adj_in_set will call bgp_attr_intern to intern
attr pointer. If given attr isn't found in attrhash, hash_get will call
bgp_attr_hash_alloc to allocate new attr structure. In
bgp_attr_hash_alloc, NULL will be assigned to srv6_vpn field and
srv6_l3vpn field in origin attr pointer. attr->srv6_vpn and
attr->srv6_l3vpn are interned in bgp_attr_intern, so NULL assignment
isn't needed.

And, these fields are used later in bgp_update to set SRv6 information
to bgp_path_info. If bgp_attr_hash_alloc assign NULL to these fields,
SRv6 information will be lost and incorrect routes are inserted into
data-plane.

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
2021-12-16 23:28:12 +09:00
Stephen Worley
ad1229a077
Merge pull request #10215 from FRRouting/revert-10164-name_change
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
2021-12-15 17:40:53 -05:00