]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
18 months agoMerge pull request #12147 from pguibert6WIND/srte_flush
Donatas Abraitis [Thu, 17 Nov 2022 13:26:55 +0000 (15:26 +0200)]
Merge pull request #12147 from pguibert6WIND/srte_flush

zebra: upon srte leave, flush sr policies

18 months agoMerge pull request #12302 from louis-6wind/fix-isis_route_null-area
Olivier Dugeon [Thu, 17 Nov 2022 11:25:43 +0000 (12:25 +0100)]
Merge pull request #12302 from louis-6wind/fix-isis_route_null-area

isisd: fix area NULL pointer in isis_route_update

18 months agoisisd: fix area NULL pointer in isis_route_update
Louis Scalbert [Thu, 10 Nov 2022 16:18:01 +0000 (17:18 +0100)]
isisd: fix area NULL pointer in isis_route_update

Fix the case area is NULL.

Fixes: acc0029779 ("isisd: fix potential access to NULL pointer in isis_route_update")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
18 months agoMerge pull request #12312 from pguibert6WIND/bgp_lu_rr_case
Russ White [Thu, 17 Nov 2022 02:58:09 +0000 (21:58 -0500)]
Merge pull request #12312 from pguibert6WIND/bgp_lu_rr_case

bgpd: authorise to select bgp self peer prefix on rr case

18 months agoMerge pull request #11992 from pguibert6WIND/pathd_debug
Russ White [Thu, 17 Nov 2022 02:41:33 +0000 (21:41 -0500)]
Merge pull request #11992 from pguibert6WIND/pathd_debug

Pathd debug

18 months agoMerge pull request #12324 from sworleys/Guard-InQ-Log
Donatas Abraitis [Wed, 16 Nov 2022 19:48:04 +0000 (21:48 +0200)]
Merge pull request #12324 from sworleys/Guard-InQ-Log

bgpd: debug guard inQ limit

18 months agoMerge pull request #12259 from opensourcerouting/fix/show_rtt_always
Donald Sharp [Wed, 16 Nov 2022 15:28:23 +0000 (10:28 -0500)]
Merge pull request #12259 from opensourcerouting/fix/show_rtt_always

bgpd: Shutdown RTT improvements

18 months agoMerge pull request #11058 from opensourcerouting/fix/redhat_debian_logrotate
Jafar Al-Gharaibeh [Wed, 16 Nov 2022 04:15:45 +0000 (22:15 -0600)]
Merge pull request #11058 from opensourcerouting/fix/redhat_debian_logrotate

packaging: Reuse frr.logrotate for Debian and Redhat builds

18 months agobgpd: debug guard inQ limit
Stephen Worley [Tue, 15 Nov 2022 20:28:09 +0000 (15:28 -0500)]
bgpd: debug guard inQ limit

Add a debug guard for the inQ limit.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
18 months agoMerge pull request #12291 from anlancs/pimd/mtrace-fd
Stephen Worley [Tue, 15 Nov 2022 16:46:27 +0000 (11:46 -0500)]
Merge pull request #12291 from anlancs/pimd/mtrace-fd

pimd: delay creating the socket

18 months agobgpd: authorise to select bgp self peer prefix on rr case
Philippe Guibert [Mon, 7 Nov 2022 10:56:37 +0000 (11:56 +0100)]
bgpd: authorise to select bgp self peer prefix on rr case

This commit addresses an issue that happens when using bgp
peering with a rr client, with a received prefix which is the
local ip address of the bgp session.

When using bgp ipv4 unicast session, the local prefix is
received by a peer, and finds out that the proposed prefix
and its next-hop are the same. To avoid a route loop locally,
no nexthop entry is referenced for that prefix, and the route
will not be selected.

When the received peer is a route reflector, the prefix has
to be selected, even if the route can not be installed locally.

Fixes: ("fb8ae704615c") bgpd: prevent routes loop through itself
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agoMerge pull request #12307 from mtomaschewski/declare-a-check
Donatas Abraitis [Tue, 15 Nov 2022 07:13:33 +0000 (09:13 +0200)]
Merge pull request #12307 from mtomaschewski/declare-a-check

tools: remove backslash from declare check regex

18 months agoMerge pull request #12315 from donaldsharp/dplane_sorry
Donatas Abraitis [Tue, 15 Nov 2022 07:11:33 +0000 (09:11 +0200)]
Merge pull request #12315 from donaldsharp/dplane_sorry

Dplane sorry

18 months agoMerge pull request #12045 from patrasar/pimv6_rpf_fix
Donatas Abraitis [Mon, 14 Nov 2022 20:05:15 +0000 (22:05 +0200)]
Merge pull request #12045 from patrasar/pimv6_rpf_fix

pimd, pim6d: Update upstream IIF when pim disabled and enabled on an interface

18 months agopathd: display SRTE policy status when removing policy
Philippe Guibert [Mon, 25 Jul 2022 13:06:35 +0000 (15:06 +0200)]
pathd: display SRTE policy status when removing policy

Create a function that logs the status of a given SR-TE policy.
Add a call to this function when a policy is being removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agopathd: some traces are added to 'debug pathd ted' command.
Philippe Guibert [Mon, 25 Jul 2022 12:57:10 +0000 (14:57 +0200)]
pathd: some traces are added to 'debug pathd ted' command.

Some traces initially displayed will be hidden behind the
vty command: 'debug pathd ted'.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agopathd: use a define to store the the length of endpoint string
Philippe Guibert [Tue, 19 Jul 2022 12:59:23 +0000 (14:59 +0200)]
pathd: use a define to store the the length of endpoint string

The endpoint string is a 46 byte length buffer. Use a single
place to store the length of that buffer.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agopathd: add 'debug pathd policy' command
Philippe Guibert [Mon, 25 Jul 2022 12:55:37 +0000 (14:55 +0200)]
pathd: add 'debug pathd policy' command

Add a new cli command to troubleshoort pathd daemon.
Some traces initially enabled are hidden behind this
cli command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agopathd: display path ted debugging status
Philippe Guibert [Wed, 21 Sep 2022 14:49:18 +0000 (16:49 +0200)]
pathd: display path ted debugging status

On 'show debugging' call, display the status about
ted debugging.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agoMerge pull request #12219 from cscarpitta/feature/srv6-usid-behavior-support
Donatas Abraitis [Mon, 14 Nov 2022 14:13:39 +0000 (16:13 +0200)]
Merge pull request #12219 from cscarpitta/feature/srv6-usid-behavior-support

bgpd, zebra: Add support for SRv6 uSID Behaviors

18 months agozebra: Fix dplane_fpm_nl to allow for fast configuration
Donald Sharp [Mon, 14 Nov 2022 13:28:45 +0000 (08:28 -0500)]
zebra: Fix dplane_fpm_nl to allow for fast configuration

If you have this order in your configuration file:

no fpm use-next-hop-groups
fpm address 127.0.0.1

the dplane code was using the same event thread t_event and the second
add event in the code was going, you already have an event scheduled
and as such the second event does not overwrite it.  Leaving
no code to actually start the whole processing.  There are probably
other cli iterations that will cause this fun as well, but I'm
not going to spend the time sussing them out at the moment.

Fixes: #12314
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agozebra: Use the enum, luke
Donald Sharp [Mon, 14 Nov 2022 13:06:16 +0000 (08:06 -0500)]
zebra: Use the enum, luke

Use the enum and let the compiler help us figure out
what cases are being missed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #12234 from opensourcerouting/fix/bgp_regex_pcre
Donald Sharp [Mon, 14 Nov 2022 12:57:47 +0000 (07:57 -0500)]
Merge pull request #12234 from opensourcerouting/fix/bgp_regex_pcre

docker: Use PCRE2 for Alpine

18 months agopimd, pim6d: Don't allow pim disabled interface as nexthop
Sarita Patra [Fri, 11 Nov 2022 07:21:35 +0000 (23:21 -0800)]
pimd, pim6d: Don't allow pim disabled interface as nexthop

While doing nexthop lookup, only allow the nexthop
interafce which is PIM enabled.

Issue: #10782
Issue: #11931

Signed-off-by: Sarita Patra <saritap@vmware.com>
18 months agopimd, pim6d: Update upstream rpf disable/enable pim on interface
Sarita Patra [Fri, 11 Nov 2022 06:59:58 +0000 (22:59 -0800)]
pimd, pim6d: Update upstream rpf disable/enable pim on interface

Problem:
When "no ip pim" is executed on source connected interface, its
ifp->info is set to NULL. But KAT on this interface is still
running, it wrongly dereferences NULL. This leads to crash.

Root Cause:
pim upstream IIF is still pointing towards the source connected
interface which is not pim enabled and Mroute is still present in
the kernel.

Fix:
When “no ip pim” command gets executed on source connected interface,
then loop through all the pnc->nexthop, if any new nexthop found,
then update the upstream IIF accordindly, if not found then update
the upstream IIF as Unknown and uninstall the mroute from kernel.

When “ip pim” command gets executed on source connected interface,
then also loop through all the pnc->nexthop  and update the upstream IIF,
install the mroute in kernel.

Issue: #10782
Issue: #11931

Signed-off-by: Sarita Patra <saritap@vmware.com>
18 months agopimd, pim6d: Introduce pnc_hash_walk_data structure
Sarita Patra [Fri, 11 Nov 2022 06:55:53 +0000 (22:55 -0800)]
pimd, pim6d: Introduce pnc_hash_walk_data structure

This structure will contain pim_instance and interface
data.

Signed-off-by: Sarita Patra <saritap@vmware.com>
18 months agopim6d: Handle IPV6 for "no ipv6 pim"
Sarita Patra [Fri, 21 Oct 2022 09:00:10 +0000 (02:00 -0700)]
pim6d: Handle IPV6 for "no ipv6 pim"

Issue: #11931

Signed-off-by: Sarita Patra <saritap@vmware.com>
18 months agoMerge pull request #12308 from mtomaschewski/pam-account-warning
Donatas Abraitis [Sat, 12 Nov 2022 20:35:53 +0000 (22:35 +0200)]
Merge pull request #12308 from mtomaschewski/pam-account-warning

pam: declare root as sufficient frr pam account

18 months agopam: declare root as sufficient frr pam account
Marius Tomaschewski [Fri, 11 Nov 2022 13:50:12 +0000 (14:50 +0100)]
pam: declare root as sufficient frr pam account

https://github.com/FRRouting/frr/pull/11465 enabled account verification,
but the pam config declares rootok as sufficient in authentication only
and not in account verification, what causes warning in the log:

vtysh[3747]: pam_warn(frr:account): function=[pam_sm_acct_mgmt]
             flags=0 service=[frr] terminal=[<unknown>] user=[root]
     ruser=[<unknown>] rhost=[<unknown>]

Signed-off-by: Marius Tomaschewski <mt@suse.com>
18 months agotools: remove backslash from declare check regex
Marius Tomaschewski [Fri, 11 Nov 2022 11:26:04 +0000 (12:26 +0100)]
tools: remove backslash from declare check regex

The backslash in `grep -q '^declare \-a'` is not needed and
causes `grep: warning: stray \ before -` warning in grep-3.8.

Signed-off-by: Marius Tomaschewski <mt@suse.com>
18 months agoMerge pull request #12303 from donaldsharp/relax_if_type_check
Jafar Al-Gharaibeh [Fri, 11 Nov 2022 06:14:41 +0000 (00:14 -0600)]
Merge pull request #12303 from donaldsharp/relax_if_type_check

zebra: relax if_type check to allow early ES config creation

18 months agoMerge pull request #12269 from pguibert6WIND/ospf_external_lsa_crash
Jafar Al-Gharaibeh [Thu, 10 Nov 2022 19:20:50 +0000 (13:20 -0600)]
Merge pull request #12269 from pguibert6WIND/ospf_external_lsa_crash

ospfd: prevent from crashing when processing external lsa

18 months agozebra: relax if_type check to allow early ES config creation
Anuradha Karuppiah [Fri, 29 May 2020 16:53:31 +0000 (09:53 -0700)]
zebra: relax if_type check to allow early ES config creation

The API for configuring ES in zebra had a strict check for if_type
"isBond" that prevented the ES config from being created before the
interface.

Ticket: CM-29454

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
18 months agoospfd: prevent from crashing when processing external lsa
Philippe Guibert [Mon, 7 Nov 2022 10:03:41 +0000 (11:03 +0100)]
ospfd: prevent from crashing when processing external lsa

When using debug mode, the ei parameter may be NULL. In that
case, do not display the log trace, otherwise a crash will
happen.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agoMerge pull request #12297 from donaldsharp/pim_warn_to_debug
Jafar Al-Gharaibeh [Wed, 9 Nov 2022 22:17:14 +0000 (16:17 -0600)]
Merge pull request #12297 from donaldsharp/pim_warn_to_debug

pimd: Convert zlog_warn to debug

18 months agoMerge pull request #12287 from donaldsharp/bgp_rpki_takes_too_long
Donatas Abraitis [Wed, 9 Nov 2022 19:25:44 +0000 (21:25 +0200)]
Merge pull request #12287 from donaldsharp/bgp_rpki_takes_too_long

Bgp rpki takes too long

18 months agopimd: Convert zlog_warn to debug
Donald Sharp [Fri, 22 Nov 2019 20:12:05 +0000 (15:12 -0500)]
pimd: Convert zlog_warn to debug

The unable to find a nexthop should not be a warning it should
be a debug.  Switching over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
18 months agoMerge pull request #11736 from kuldeepkash/pim_v6
Donatas Abraitis [Wed, 9 Nov 2022 15:56:32 +0000 (17:56 +0200)]
Merge pull request #11736 from kuldeepkash/pim_v6

[PIMv6] Add new scenarios to multicast static_rp suite

18 months agoMerge pull request #12281 from SaiGomathiN/11279
Donatas Abraitis [Wed, 9 Nov 2022 13:14:46 +0000 (15:14 +0200)]
Merge pull request #12281 from SaiGomathiN/11279

tools: Add pim6d support bundle commands

18 months agopimd: delay creating the socket
anlan_cs [Wed, 9 Nov 2022 08:53:11 +0000 (03:53 -0500)]
pimd: delay creating the socket

Bring error handling up front and delay creating socket so that
we don't think too much about closing the socket in error cases.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
18 months agoMerge pull request #12280 from opensourcerouting/fix/ospv6_show_passive_interface
Jafar Al-Gharaibeh [Wed, 9 Nov 2022 05:25:39 +0000 (23:25 -0600)]
Merge pull request #12280 from opensourcerouting/fix/ospv6_show_passive_interface

ospf6d: Show if the interface is passive for `show ipv6 ospf6 interface`

18 months agoMerge pull request #12286 from ffontaine/master
Jafar Al-Gharaibeh [Wed, 9 Nov 2022 05:24:34 +0000 (23:24 -0600)]
Merge pull request #12286 from ffontaine/master

zebra/netconf_netlink.c: fix build without AF_MPLS

18 months agodoc: Add documentation for behavior usid command
Carmine Scarpitta [Thu, 27 Oct 2022 22:11:02 +0000 (00:11 +0200)]
doc: Add documentation for behavior usid command

Add the documentation for the `behavior usid` command to zebra.

When the `behavior usid` command is set, a flag is added to the locator
to indicate that the locator is a uSID locator. When a locator is
specified as a uSID locator, the bgpd will install SRv6 behaviors with
the uSID in the dataplane and use the SRv6 uSID codepoints in the BGP
update message.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agotests: Add topotest for SRv6 uSID Locator
Carmine Scarpitta [Thu, 27 Oct 2022 21:40:09 +0000 (23:40 +0200)]
tests: Add topotest for SRv6 uSID Locator

This test ensures that the command `behavior usid` works properly.

When the `behavior usid` command is set, a flag is added to the locator
to indicate that the locator is a uSID locator. This test verifies that
the locator works correctly when you set / unset the `behavior usid`
command.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agozebra: Add `behavior usid` command to VTY
Carmine Scarpitta [Thu, 27 Oct 2022 18:08:40 +0000 (20:08 +0200)]
zebra: Add `behavior usid` command to VTY

Install a new command `behavior usid` into the `SRV6_LOC_NODE` CLI node.

This command allows the user to set/unset the `SRV6_LOCATOR_USID` flag
for an SRv6 locator. The `SRV6_LOCATOR_USID` flag indicates whether a
locator is a uSID locator or not. When the flag is set, the routing
daemons (e.g., bgpd) will install SRv6 behaviors with the uSID in the
dataplane.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agozebra: Add helpers to notify locator add/delete
Carmine Scarpitta [Fri, 28 Oct 2022 23:28:30 +0000 (01:28 +0200)]
zebra: Add helpers to notify locator add/delete

In this commit, we add two helper functions
`zebra_notify_srv6_locator_add` and `zebra_notify_srv6_locator_delete`.
These functions are used to notify locator additions/deletions to
zclients.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agolib,zebra: Add SRv6 uSID info to VTY output
Carmine Scarpitta [Thu, 27 Oct 2022 18:01:24 +0000 (20:01 +0200)]
lib,zebra: Add SRv6 uSID info to VTY output

In this commit, we extend to print the `SRV6_LOCATOR_USID` flag.
The output appears as follows:

```
{
  "locators":[
    {
      "name":"loc1",
      "prefix":"fc00:0:1::/48",
      "blockBitsLength":32,
      "nodeBitsLength":16,
      "functionBitsLength":16,
      "argumentBitsLength":0,
      "uSID":true,
      "statusUp":true,
      "chunks":[
        {
          "prefix":"fc00:0:1::/48",
          "proto":"bgp"
        }
      ]
    }
  ]
}
```

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agobgpd: Use SRv6 codepoints in the BGP Advertisement
Carmine Scarpitta [Thu, 27 Oct 2022 17:47:11 +0000 (19:47 +0200)]
bgpd: Use SRv6 codepoints in the BGP Advertisement

Currently bgpd uses the opaque codepoint (0xFFFF) in the BGP
advertisement. In this commit, we update bgpd to use the SRv6 codepoints
defined in the IANA SRv6 Endpoint Behaviors Registry
(https://www.iana.org/assignments/segment-routing/segment-routing.xhtml)

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agolib: Add support for SRv6 Behavior codepoints
Carmine Scarpitta [Thu, 27 Oct 2022 17:31:34 +0000 (19:31 +0200)]
lib: Add support for SRv6 Behavior codepoints

In this commit, we introduce a new enumeration to encode the SRv6
Endpoint Behaviors codepoints defined in the IANA SRv6 Endpoint
Behaviors Registry
(https://www.iana.org/assignments/segment-routing/segment-routing.xhtml).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
18 months agobgpd: rpki was decrementing the node lock one time too many
Donald Sharp [Tue, 8 Nov 2022 19:38:02 +0000 (14:38 -0500)]
bgpd: rpki was decrementing the node lock one time too many

The code was this:

1)        match = bgp_table_subtree_lookup(rrp->bgp->rib[rrp->afi][rrp->safi],
                                         &rrp->prefix);

2)        node = match;

        while (node) {
                if (bgp_dest_has_bgp_path_info_data(node)) {
                        revalidate_bgp_node(node, rrp->afi, rrp->safi);
                }

3)               node = bgp_route_next_until(node, match);
        }

if (match)
4)              bgp_dest_unlock_node(match);

At 1) match was locked and became +1
At 2) match and node are now equal
At 3) On first iteration, match is decremented( as that node points
at it ) and the next item is locked, if it is found, and returned which becomes node

If 3 is run again because node is non-null then, current node is decremented
and the next node found is incremented and returned which becomes node again.

So if we get to 4) match is unlocked again which is now a double unlock
which, frankly, is not good.  In all code paths that I can see the
test for `if (match) ...` is not needed so let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #11302 from punith-shivakumar/master
Donatas Abraitis [Tue, 8 Nov 2022 19:28:30 +0000 (21:28 +0200)]
Merge pull request #11302 from punith-shivakumar/master

ospf6d: add missing ABR task on interface start and change default task delay to 5

18 months agoMerge pull request #11594 from louis-6wind/lfa-netlink
Pushpasis Sarkar [Tue, 8 Nov 2022 17:49:39 +0000 (23:19 +0530)]
Merge pull request #11594 from louis-6wind/lfa-netlink

isisd: apply fast-reroute as soon an interface or an adjacency falls down

18 months agozebra/netconf_netlink.c: fix build without AF_MPLS
Fabrice Fontaine [Tue, 8 Nov 2022 17:48:41 +0000 (18:48 +0100)]
zebra/netconf_netlink.c: fix build without AF_MPLS

Fix the following build failure raised since version 8.4 and
https://github.com/FRRouting/frr/commit/d53dc9bd8164ba40242e2013d382fb01eb0b96ed:

zebra/netconf_netlink.c: In function 'netlink_netconf_change':
zebra/netconf_netlink.c:109:32: error: 'AF_MPLS' undeclared (first use in this function)
  109 |         if (ncm->ncm_family == AF_MPLS)
      |                                ^~~~~~~

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
18 months agoMerge pull request #12258 from opensourcerouting/bgp-local-var-gcc-12
Jafar Al-Gharaibeh [Tue, 8 Nov 2022 16:36:36 +0000 (10:36 -0600)]
Merge pull request #12258 from opensourcerouting/bgp-local-var-gcc-12

bgpd: fix "storing the address of local variable"

19 months agobgpd: Break up rpki prefix revalidation by bgp structure
Donald Sharp [Tue, 8 Nov 2022 13:10:49 +0000 (08:10 -0500)]
bgpd: Break up rpki prefix revalidation by bgp structure

RPKI revalidation is an possibly expensive operation.  Break up
revalidation on a prefix basis by the `struct bgp` pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: rpki should use a stack pointer instead of a pointer
Donald Sharp [Tue, 8 Nov 2022 12:50:40 +0000 (07:50 -0500)]
bgpd: rpki should use a stack pointer instead of a pointer

The prefix was being allocated and freed.  No point in this
let's just use a stack pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Make rpki soft_reconfig calling events
Donald Sharp [Tue, 8 Nov 2022 12:36:56 +0000 (07:36 -0500)]
bgpd: Make rpki soft_reconfig calling events

An end operator is showing cases with multiple bgp feeds
and a rpki table that calling the revalidation functions
is extremely expensive and they are seeing lots of thread
WARNS about timers being late and eventually the whole
thing gets unresponsive.  Let's break up soft reconfiguration
in to a series of events per peer so that all the work
for this is not done at the same exact time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Use bgp pointer instead of peer pointer
Donald Sharp [Tue, 8 Nov 2022 12:16:53 +0000 (07:16 -0500)]
bgpd: Use bgp pointer instead of peer pointer

When looking up a table, use the bgp pointer that we
have.  Code cleanliness and all that.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Make calling bgp_soft_reconfig_in consistent
Donald Sharp [Tue, 8 Nov 2022 12:11:18 +0000 (07:11 -0500)]
bgpd: Make calling bgp_soft_reconfig_in consistent

Not all places were checking to see if soft reconfiguration
was turned on before calling into it to do all that work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: In rpki use FOREACH_AFI_SAFI to loop over afi/safi
Donald Sharp [Sun, 6 Nov 2022 12:52:40 +0000 (07:52 -0500)]
bgpd: In rpki use FOREACH_AFI_SAFI to loop over afi/safi

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotools: Add pim6d support bundle commands
Sai Gomathi N [Tue, 8 Nov 2022 08:09:57 +0000 (00:09 -0800)]
tools: Add pim6d support bundle commands

PIMv6 Support Bundle commands are added in support_bundle_commands.conf file.
This will help in debugging PIMv6 test Failures.

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
19 months agopackaging: Reuse frr.logrotate for Debian and Redhat builds
Donatas Abraitis [Wed, 20 Apr 2022 06:48:28 +0000 (09:48 +0300)]
packaging: Reuse frr.logrotate for Debian and Redhat builds

It will be easier to maintain a single file instead of two separate.

Also, fixes the issue when the file (/var/log/frr/frr.log) is not created
after logrotate.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoospf6d: Show if the interface is passive for `show ipv6 ospf6 interface`
Donatas Abraitis [Tue, 8 Nov 2022 07:37:19 +0000 (09:37 +0200)]
ospf6d: Show if the interface is passive for `show ipv6 ospf6 interface`

donatas-pc# sh ipv6 ospf6 interface enp3s0
enp3s0 is up, type BROADCAST
  Interface ID: 2
  Internet Address:
    inet : 192.168.10.17/24
    inet6: fe80::ca5d:fd0d:cd8:1bb7/64
  Instance ID 0, Interface MTU 1500 (autodetect: 1500)
  MTU mismatch detection: enabled
  Area ID 0.0.0.0, Cost 1000
  State Waiting, Transmit Delay 1 sec, Priority 1
  Timer intervals configured:
   Hello 10(8.149), Dead 40, Retransmit 5
  DR: 0.0.0.0 BDR: 0.0.0.0
  Number of I/F scoped LSAs is 1
    0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off]
    0 Pending LSAs for LSAck in Time 00:00:00 [thread off]
  Authentication Trailer is disabled
donatas-pc# con
donatas-pc(config)# int enp3s0
donatas-pc(config-if)# ipv6 ospf6 passive
donatas-pc(config-if)# do sh ipv6 ospf6 interface enp3s0
enp3s0 is up, type BROADCAST
  Interface ID: 2
  Internet Address:
    inet : 192.168.10.17/24
    inet6: fe80::ca5d:fd0d:cd8:1bb7/64
  Instance ID 0, Interface MTU 1500 (autodetect: 1500)
  MTU mismatch detection: enabled
  Area ID 0.0.0.0, Cost 1000
  State Waiting, Transmit Delay 1 sec, Priority 1
  Timer intervals configured:
   No Hellos (Passive interface)
  DR: 0.0.0.0 BDR: 0.0.0.0
  Number of I/F scoped LSAs is 1
    0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off]
    0 Pending LSAs for LSAck in Time 00:00:00 [thread off]
  Authentication Trailer is disabled
donatas-pc(config-if)#

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12276 from opensourcerouting/fix/ospf_wrong_arg
Jafar Al-Gharaibeh [Tue, 8 Nov 2022 04:08:18 +0000 (22:08 -0600)]
Merge pull request #12276 from opensourcerouting/fix/ospf_wrong_arg

ospfd: Get route-map name for default-information originate

19 months agoospfd: Get route-map name for default-information originate
Donatas Abraitis [Mon, 7 Nov 2022 20:23:07 +0000 (22:23 +0200)]
ospfd: Get route-map name for default-information originate

LR1.wue3(config)# route-map foo-bar-baz10 permit 10
LR1.wue3(config-route-map)# exit
LR1.wue3(config)# router ospf
LR1.wue3(config-router)#  ospf router-id 172.18.254.201
LR1.wue3(config-router)#  log-adjacency-changes
LR1.wue3(config-router)# default-information originate metric 50 metric-type 1 route-map foo-bar-baz10
LR1.wue3(config-router)# end

Results in:

LR1.wue3# show run
...
!
router ospf
 ospf router-id 172.18.254.201
 log-adjacency-changes
 default-information originate metric 50 metric-type 1 route-map oute-map
exit
!
route-map foo-bar-baz10 permit 10
exit
!
end

Let's fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodocker: Compile Alpine image using PCRE2
Donatas Abraitis [Wed, 2 Nov 2022 21:10:46 +0000 (23:10 +0200)]
docker: Compile Alpine image using PCRE2

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodocker: Use pcre2 for Alpine builds
Donatas Abraitis [Wed, 2 Nov 2022 20:30:49 +0000 (22:30 +0200)]
docker: Use pcre2 for Alpine builds

libyang already uses pcre2 too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodocker: Use Alpine 3.16 image
Donatas Abraitis [Wed, 2 Nov 2022 20:19:51 +0000 (22:19 +0200)]
docker: Use Alpine 3.16 image

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agolib: Add PCRE2 support
Donatas Abraitis [Mon, 31 Oct 2022 20:23:51 +0000 (22:23 +0200)]
lib: Add PCRE2 support

Some results:

```
====
PCRE
====
% ./a.out "^65001" "65001"
comparing: ^65001 / 65001

ret status: 0
[14:31] donatas-pc donatas /home/donatas
% ./a.out "^65001_" "65001"
comparing: ^65001_ / 65001

ret status: 0

=====
PCRE2
=====
% ./a.out "^65001" "65001"
comparing: ^65001 / 65001

ret status: 0
[14:30] donatas-pc donatas /home/donatas
% ./a.out "^65001_" "65001"
comparing: ^65001_ / 65001

ret status: 1
```

Seems that if using PCRE2, we need to escape outer `()` chars and `|`. Sounds
like a bug.
But this is only with some older PCRE2 versions. With >= 10.36, I wasn't able
to reproduce this, everything is fine and working as expected.

Adding _FRR_PCRE2_POSIX definition because pcre2posix.h does not have
include's guard.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodocker: Reuse all possible cores when building FRR for Alpine
Donatas Abraitis [Mon, 31 Oct 2022 19:40:22 +0000 (21:40 +0200)]
docker: Reuse all possible cores when building FRR for Alpine

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12268 from opensourcerouting/fix/zebra_tc_include_netinet_for_ethhdr
Donald Sharp [Mon, 7 Nov 2022 18:33:37 +0000 (13:33 -0500)]
Merge pull request #12268 from opensourcerouting/fix/zebra_tc_include_netinet_for_ethhdr

zebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr

19 months agotests: Add pim6d marker to pytest.ini
Kuldeep Kashyap [Mon, 8 Aug 2022 00:02:02 +0000 (17:02 -0700)]
tests: Add pim6d marker to pytest.ini

Added pim6d marker to pytest.ini file,
to run tests pim6d marker based, if added
to scripts.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
19 months agotests: [PIMv6] Add new scenarios to static_rp suite
Kuldeep Kashyap [Wed, 3 Aug 2022 08:34:33 +0000 (01:34 -0700)]
tests: [PIMv6] Add new scenarios to static_rp suite

Automated new scenarios to multicast pimv6
static rp test suite. Added new folder
multicast_pim6_static_rp_topo1 for pimv6
static_rp automation.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
19 months agotests: [PIMv6] F/W support for multicast pimv6 automation
Kuldeep Kashyap [Wed, 3 Aug 2022 08:32:54 +0000 (01:32 -0700)]
tests: [PIMv6] F/W support for multicast pimv6 automation

Enhanced or added new libraries to support
multicast pimv6 automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
19 months agoMerge pull request #12238 from donaldsharp/append
Donatas Abraitis [Mon, 7 Nov 2022 08:37:05 +0000 (10:37 +0200)]
Merge pull request #12238 from donaldsharp/append

lib, zebra: Allow for zebra to recognize that a route has gotten desy…

19 months agoMerge pull request #12263 from anlancs/fix/pimd-log-bug
mobash-rasool [Mon, 7 Nov 2022 07:10:19 +0000 (12:40 +0530)]
Merge pull request #12263 from anlancs/fix/pimd-log-bug

pimd: avoid one EC log

19 months agoMerge pull request #12188 from donaldsharp/resilience
Donatas Abraitis [Sun, 6 Nov 2022 20:57:04 +0000 (22:57 +0200)]
Merge pull request #12188 from donaldsharp/resilience

Resilience

19 months agozebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr
Donatas Abraitis [Wed, 2 Nov 2022 21:01:18 +0000 (23:01 +0200)]
zebra: Reuse netinet/if_ether.h to avoid redefinition of struct ethhdr

In file included from /usr/include/net/ethernet.h:10,
                 from ./lib/prefix.h:26,
                 from zebra/tc_netlink.c:32:
/usr/include/netinet/if_ether.h:115:8: error: redefinition of 'struct ethhdr'
  115 | struct ethhdr {
      |        ^~~~~~
In file included from zebra/tc_netlink.c:28:
/usr/include/linux/if_ether.h:169:8: note: originally defined here
  169 | struct ethhdr {
      |        ^~~~~~

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agopimd: avoid one EC log
anlan_cs [Sat, 5 Nov 2022 13:33:01 +0000 (21:33 +0800)]
pimd: avoid one EC log

Saw this EC log:

```
PIM: [WX4HZ-FA72S][EC 100663307] pim_rp_find_match_group: BUG We should have found default group information
```

The root cause is group address of "0.0.0.0" is wrongly introduced into
`pim_rp_find_match_group()`. So add a check to avoid it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
19 months agotests: Test Resilient NHG's are properly created in zebra
Donald Sharp [Wed, 26 Oct 2022 19:47:08 +0000 (15:47 -0400)]
tests: Test Resilient NHG's are properly created in zebra

When a Resilient NHG is created, ensure that Zebra notes
that it is created and has it as well.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
19 months agotests: Speedup test_all_protocol_startup.py by 55 seconds
Donald Sharp [Wed, 26 Oct 2022 15:53:20 +0000 (11:53 -0400)]
tests: Speedup test_all_protocol_startup.py by 55 seconds

Just make ospf and ospfv3 converge faster with faster
hello timers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agodoc: Add nexthop_groups documentation
Donald Sharp [Mon, 24 Oct 2022 18:26:11 +0000 (14:26 -0400)]
doc: Add nexthop_groups documentation

Remove the nexthop groups documentation from pbr.rst and
make it `generic`.  Add the resilient buckets nexthop
group type.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months ago*: Add ability to encode / decode resilence down zapi
Donald Sharp [Mon, 24 Oct 2022 13:49:40 +0000 (09:49 -0400)]
*: Add ability to encode / decode resilence down zapi

At this point add abilty for the encode/decode of the
resilience down ZAPI to zebra.  Just hookup sharpd
at this point in time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months ago*: Add ability for daemons to notice resilience changes
Donald Sharp [Mon, 24 Oct 2022 13:25:54 +0000 (09:25 -0400)]
*: Add ability for daemons to notice resilience changes

This patch just introduces the callback mechanism for the
resilient nexthop changes so that upper level daemons
can take advantage of the change.  This does nothing
at this point but just call some code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, vtysh: Add ability to specify resilient nhgs
Donald Sharp [Mon, 24 Oct 2022 13:09:23 +0000 (09:09 -0400)]
lib, vtysh: Add ability to specify resilient nhgs

Add the ability to specify a resilient nexthop group

nexthop-group A
 resilient buckets 32 idle_timer 100 unbalanced_timer 500
 nexthop 192.168.100.1 enp7s0
 nexthop 192.168.100.33 enp7s0
 nexthop 192.168.122.1 enp1s0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, zebra: Add ability to encode/decode resilient nhg's
Donald Sharp [Sat, 22 Oct 2022 19:37:27 +0000 (15:37 -0400)]
lib, zebra: Add ability to encode/decode resilient nhg's

Add ability to read the nexthop group resilient linux
kernel data as well as write it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: When adding to front of list ensure we handle tail to
Donald Sharp [Mon, 24 Oct 2022 18:08:35 +0000 (14:08 -0400)]
lib: When adding to front of list ensure we handle tail to

When inserting to the front of a list with listnode_add_head
if the list is empty, the tail will not be properly set and
subsuquent calls to insert/remove will cause the function
to crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, zebra: Allow for zebra to recognize that a route has gotten desynced
Donald Sharp [Tue, 1 Nov 2022 12:00:14 +0000 (08:00 -0400)]
lib, zebra: Allow for zebra to recognize that a route has gotten desynced

FRR does not use the NLM_F_APPEND semantics ( in fact I would argue that
the NLM_F_APPEND semantics just introduce pain for all parties involved )
I would also argue that most people who use the kernel netlink api
have recognized that NLM_F_APPEND for a route is a recipe for disaster
that is well documented and as such it is not used as anything other
than a curiousity by operators.

See:
https://bugzilla.redhat.com/show_bug.cgi?id=1337855
https://github.com/thom311/libnl/issues/226

Are 2 great examples of how confusing it is for anyone in user
space to know what the correct thing to do is.  Given that
new fields can be added with no semantics to allow us to know
what has resulted in a change or not.

In an attempt to recognize this, let's note that FRR
believes it has gotten out of sync with the kernel.
Future commits will react to the desynchronized route
and request from the kernel a reload of that specific
route if possible.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #12244 from anlancs/fix/bgpd-evpn-leak-l3rt
Donald Sharp [Fri, 4 Nov 2022 15:59:32 +0000 (11:59 -0400)]
Merge pull request #12244 from anlancs/fix/bgpd-evpn-leak-l3rt

bgpd: avoid possible memleak

19 months agoMerge pull request #12252 from opensourcerouting/fix/frr-reload.py_reuse_non_default_dirs
Donald Sharp [Fri, 4 Nov 2022 15:58:37 +0000 (11:58 -0400)]
Merge pull request #12252 from opensourcerouting/fix/frr-reload.py_reuse_non_default_dirs

tools: Honor sysdir, confdir, bindir for frr-reload.py from "frr" wrapper

19 months agobgpd: Show the counters for RTT when shutdown on RTT feature is enabled
Donatas Abraitis [Fri, 4 Nov 2022 14:07:07 +0000 (16:07 +0200)]
bgpd: Show the counters for RTT when shutdown on RTT feature is enabled

    "shutdownRttInMsecs":5,
    "shutdownRttAfterCount":5,

Estimated round trip time: 116 ms
Shutdown when RTT > 5ms, count > 17

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Show the reason when the session is killed due to RTT
Donatas Abraitis [Fri, 4 Nov 2022 13:40:52 +0000 (15:40 +0200)]
bgpd: Show the reason when the session is killed due to RTT

Simulated latency with:

```
tc qdisc add dev eth3 root netem delay 100ms
```

```
donatas-laptop# sh ip bgp summary failed

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.0.2.252, local AS number 65000 vrf-id 0
BGP table version 28
RIB entries 0, using 0 bytes of memory
Peers 1, using 724 KiB of memory

Neighbor        EstdCnt DropCnt ResetTime Reason
192.168.10.65         2       2  00:00:17 Admin. shutdown (RTT)

Displayed neighbors 1
Total number of neighbors 1
donatas-laptop#
```

Another end received:

```
%NOTIFICATION: received from neighbor 192.168.10.17 6/2 (Cease/Administrative Shutdown) "shutdown due to high round-trip-time (104ms > 5ms, hit 21 times)"
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Always show estimated RTT to the peer
Donatas Abraitis [Fri, 4 Nov 2022 12:46:14 +0000 (14:46 +0200)]
bgpd: Always show estimated RTT to the peer

It's very annoying when flapping between 0 (missing the output) and non-zero.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12251 from donaldsharp/various_and_sundry
Donatas Abraitis [Fri, 4 Nov 2022 12:03:50 +0000 (14:03 +0200)]
Merge pull request #12251 from donaldsharp/various_and_sundry

Various and sundry

19 months agoMerge pull request #12256 from opensourcerouting/fix/llgr_max_values
Donald Sharp [Fri, 4 Nov 2022 12:00:06 +0000 (08:00 -0400)]
Merge pull request #12256 from opensourcerouting/fix/llgr_max_values

bgpd: Cap LLGR stale-time to 16777215

19 months agoMerge pull request #12257 from opensourcerouting/fix/bgp_orf_reserved
Donald Sharp [Fri, 4 Nov 2022 11:59:14 +0000 (07:59 -0400)]
Merge pull request #12257 from opensourcerouting/fix/bgp_orf_reserved

bgpd: Check and print if we receive ORF reserved type

19 months agobgpd: fix "storing the address of local variable"
David Lamparter [Fri, 4 Nov 2022 11:33:28 +0000 (12:33 +0100)]
bgpd: fix "storing the address of local variable"

New GCC 12 warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoMerge pull request #12255 from donaldsharp/established_lost
Donatas Abraitis [Fri, 4 Nov 2022 11:27:47 +0000 (13:27 +0200)]
Merge pull request #12255 from donaldsharp/established_lost

bgpd: Limit snmp trap for backwards state movement from established

19 months agobgpd: Cap LLGR stale-time to 16777215
Donatas Abraitis [Fri, 4 Nov 2022 06:21:18 +0000 (08:21 +0200)]
bgpd: Cap LLGR stale-time to 16777215

This value is 3 bytes (24-bits), let's do not overuse this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Limit snmp trap for backwards state movement from established
Donald Sharp [Fri, 4 Nov 2022 00:39:39 +0000 (20:39 -0400)]
bgpd: Limit snmp trap for backwards state movement from established

Currently the bgp mib specifies two traps:

a) Into established state
b) transition backwards from a state

b) really is an interesting case.  It means transitioning
from say established to starting over.  It can also
mean when bgp is trying to connect and that fails and
the state transitions backwards.

Now let's imagine 500 peers with tight timers (say a data center)
and there is network trauma you have just created an inordinately
large number of traps for each peer.

Let's limit FRR to changing from the old status as Established
to something else.  This will greatly limit the trap but it
will also be something end operators are actually interested in.

I actually had several operators say they had to write special code
to ignore all the backward state transitions that they didn't care
about.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>