Ryoga Saito [Tue, 31 Aug 2021 06:13:17 +0000 (06:13 +0000)]
bgpd: introduce SID structure information
draft-ietf-bess-srv6-services-07 defines new SID structure Sub-Sub-TLV.
This patch adds SID structure information to bgp_attr_srv6_l3vpn. This
patch also defines default SID stucture used by following patches.
Ryoga Saito [Tue, 31 Aug 2021 06:31:44 +0000 (06:31 +0000)]
bgpd: introduce new alloc algorithm for SRv6 SID
Current implementation of SRv6 SID allocation algorithm sets most least
2 bytes. But, according to RFC8986, function bits is located in the next
to locator. New allocation alogirithm respects this format.
Ryoga Saito [Tue, 17 Aug 2021 10:22:33 +0000 (10:22 +0000)]
bgpd: fix parser of srv6 infomation
bgpd couldn't parse SRv6 SID Information Sub-TLV correctly.
draft-ietf-bess-srv6-services-07 also defines SRv6 SID Structure
Sub-Sub-TLV. This patch adds the parser for SRv6 SID Structure
Sub-Sub-TLV.
Ryoga Saito [Tue, 17 Aug 2021 10:13:04 +0000 (10:13 +0000)]
bgpd: fix prefix sid sub-tlv header is missing
draft-ietf-bess-srv6-services-07 defines SRv6 Service Sub-TLV header,
but, current bgpd implementation send path attribute without SRv6
Service Sub-TLV header.
ospfd: Summarised External LSA is not flushed in one scenario
Fix CI Failure test_ospf_type5_summary_tc45_p0
Problem Statement:
==================
Summarised LSA is not flushed in OSPFv2 in below scenario:
1. Configure summary-address in ospfv2
2. redistribute static and connected.
3. Check the LSAs are received on neighbor.
4. Now remove all OSPFv2 configs, so neighbor will still have the summarised LSA.
5. Configure router ospf with redistribute static and connected.
6. Check the DB, summarised LSA is present although the configuration is not present.
7. Now configure the summary-address and remove the configuration after sometime.
8. The summarised LSA will be still present.
RCA:
==================
When self originated LSA is received from the neighbor and that
LSA is summarised one, the LSA is refreshed but a flag is not set
due to which it was not able to remove it later.
Fix:
==================
Set the originated flag when refreshing summarised LSA.
Donald Sharp [Mon, 16 Aug 2021 14:59:20 +0000 (10:59 -0400)]
bgpd: Add code to output expire and retry interval for rpki
The code to output during a `show run` is missing for both
the expire_interval and the retry_interval in rpki.
Let's add it in so the end user can see what they
are set to if not set to the default.
Donald Sharp [Sun, 15 Aug 2021 14:22:50 +0000 (10:22 -0400)]
bgpd: Continue processing rpki nodes
We are prematurely stopping processing of bgp_path_info's
when bgp_update returns a -1. The only place that this
happens when we cross some prefix limit. But we still
need to continiue processing other nodes in the list too.
Donald Sharp [Sun, 15 Aug 2021 14:15:38 +0000 (10:15 -0400)]
bgpd: Limit processing to what is needed in rpki validation
The processing was looping over all bgp instances then
over all peers then over all safi's to find a match
for a prefix received in order to validate it.
Suppose you have 100 peers each sending you the same
prefix. This code will cause it to look at each node 100
times since we look at for each peer. This is especially
egregarious because we never ever do anything with the peer
when we are looping over them.
Remove the peer loop, significantly reduce processing.
Directory name for a new topotest must not contain hyphen (-) characters.
To separate words, use underscores (_). For example, tests/topotests/bgp_new_example.
Don Slice [Wed, 11 Aug 2021 12:45:23 +0000 (08:45 -0400)]
bgpd: Stop prepending peer-as if self-originated and lastas configured
Problem seen where if "set aspath-prepend last-as" configured and
applied outbound, we prepend the peer's asn which causes our self-
originated routes to be denied.
Igor Ryzhov [Thu, 12 Aug 2021 16:07:53 +0000 (19:07 +0300)]
bgpd: fix segfault when re-adding "match evpn default-route" rule
When using "match evpn default-route" rule, match_arg is NULL and strcmp
is not happy with that. There's already a special function named rulecmp
that handles such situations.
Mark Stapp [Wed, 11 Aug 2021 17:58:13 +0000 (13:58 -0400)]
zebra: mpls validation and static lsp fixes
Handle TYPE_IFINDEX nexthops more consistently in a few places;
be more specific about a few integer return values that were
being treated as booleans.
Igor Ryzhov [Thu, 12 Aug 2021 12:49:54 +0000 (15:49 +0300)]
ospfd: fix initialization when vrf doesn't exist yet
There are a couple of things that are not initialized if the OSPF router
is created in a non-existent VRF:
- ospf_lsa_maxage_walker
- ospf_lsa_refresh_walker
- ospf_opaque_type11_lsa_init
Rearrange some code to always initialize them and make it easier to find
similar problems in the future.
Igor Ryzhov [Wed, 11 Aug 2021 14:46:31 +0000 (17:46 +0300)]
vtysh, pathd: fix pcep node-entering commands
pce-config, pce and pcc node-entering commands in vtysh include no-form,
which is incorrect. Currently, when user passes a no-form command like
`no pcc`, vtysh enters the node while pathd deletes the node and this
leads to a desynchronization.
Regular and no-form commands should be defined separately to fix this.
Martin Winter [Mon, 9 Aug 2021 23:52:05 +0000 (01:52 +0200)]
redhat: Install frr.conf only if no per daemon config exists
Install frr.conf template as a template file, but only install it
as a config file if no per daemon file exists. This will use the
integrated config with new setups, but keeps the per-daemon config
for existing users
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Igor Ryzhov [Tue, 10 Aug 2021 19:10:56 +0000 (22:10 +0300)]
yang: mark a couple of prefix-list/access-list leafs as mandatory
The code assumes that these leafs always exist when their complementary
leafs exist. For example, when processing `ipv4-exact-match`, the code
always expects to have access to `ipv4-prefix`. If those leafs are not
provided, code crashes. It doesn't happen when using the CLI because it
always does the right thing, but it can happen when using other
frontends.
Also fix incorrect description for prefix-list sequence leaf.
Igor Ryzhov [Tue, 10 Aug 2021 18:46:37 +0000 (21:46 +0300)]
lib: fix prefix-list duplication check
Currently, when we check the new prefix-list entry for duplication, we
only take filled in fields into account and ignore optional fields.
For example, if we already have `ip prefix-list A 0.0.0.0/0 le 32` and
we try to add `ip prefix-list A 0.0.0.0/0`, it is treated as duplicate.
We should always compare all prefix-list fields when doing the check.
Donatas Abraitis [Tue, 10 Aug 2021 08:04:57 +0000 (11:04 +0300)]
bgpd: Auto-complete for `show bgp <afi> <safi> large-community-list`
```
exit1-debian-9# show ip bgp large-community-list
(1-500) large-community-list number
LCOMMUNITY_LIST_NAME large-community-list name
large-testas
```
Donald Lee [Mon, 9 Aug 2021 23:07:06 +0000 (07:07 +0800)]
lib: Enable consecutive frrscript_call
Previous:
- frrscript_load: push Lua function onto stack
- frrscript_call: calls Lua function
Now:
- frrscript_load: checks Lua function
- frrscript_call: pushes and calls Lua function (first clear the stack)
So now we just need one frrscript_load for consecutive frrscript_call.
frrscript_call does not recompile or reload the script file, it just
keys it from the global Lua table (where it should already be).
ospf6d: Remove assert and fix LSA removal in ASBR summarisation
Fix:
1. The assert at line ospf6_asbr.c:2849 is not required.
2. When Individual LSAs are present and summarisation is configured
we need to remove such LSAs and originate the summarised ones.
Donald Sharp [Mon, 9 Aug 2021 12:01:06 +0000 (08:01 -0400)]
zebra: Properly note add/update for rib_add_multipath_nhe
When calling rib_add_multipath_nhe ensure that we have
well aligned return codes that mean something so that
interersted parties can properly handle the situation.