]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
11 months agopathd: clean up a log message 15891/head
Mark Stapp [Tue, 30 Apr 2024 18:34:58 +0000 (14:34 -0400)]
pathd: clean up a log message

Clean up a typo in a log message.

Signed-off-by: Mark Stapp <mjs@cisco.com>
11 months agopathd: retry synchronous label-manager zapi connection
Mark Stapp [Tue, 30 Apr 2024 18:33:13 +0000 (14:33 -0400)]
pathd: retry synchronous label-manager zapi connection

Be prepared to retry setting up pathd's synchronous zapi session
that's used for label-manager.

Signed-off-by: Mark Stapp <mjs@cisco.com>
12 months agoMerge pull request #15766 from louis-6wind/fix-network-rd
Donatas Abraitis [Wed, 24 Apr 2024 11:34:19 +0000 (14:34 +0300)]
Merge pull request #15766 from louis-6wind/fix-network-rd

bgpd: fix show run of network route-distinguisher

12 months agoMerge pull request #15819 from louis-6wind/fix-snmp-oid
Donald Sharp [Wed, 24 Apr 2024 11:25:22 +0000 (07:25 -0400)]
Merge pull request #15819 from louis-6wind/fix-snmp-oid

bgpd, ospfd: fix non increasing SNMP OID

12 months agoMerge pull request #15769 from raja-rajasekar/rajasekarr/backpressure_display_i_o_buf
Mark Stapp [Tue, 23 Apr 2024 17:01:35 +0000 (13:01 -0400)]
Merge pull request #15769 from raja-rajasekar/rajasekarr/backpressure_display_i_o_buf

zebra: Actually display I/O buffer sizes (part-2)

12 months agoMerge pull request #15801 from LabNConsulting/chopps/new-munet
Donald Sharp [Tue, 23 Apr 2024 16:58:48 +0000 (12:58 -0400)]
Merge pull request #15801 from LabNConsulting/chopps/new-munet

Improve coverage functionality

12 months agoMerge pull request #15810 from opensourcerouting/fix/enforce_first_as_bgp_peer-group
Donald Sharp [Tue, 23 Apr 2024 16:57:24 +0000 (12:57 -0400)]
Merge pull request #15810 from opensourcerouting/fix/enforce_first_as_bgp_peer-group

bgpd: Inherit some peer flags from the peer-group

12 months agoMerge pull request #15714 from mjstapp/sync_pthread_startup
Donald Sharp [Tue, 23 Apr 2024 16:55:27 +0000 (12:55 -0400)]
Merge pull request #15714 from mjstapp/sync_pthread_startup

lib: serialize pthread startup

12 months agoMerge pull request #15815 from donaldsharp/blackhole_reinstall
Mark Stapp [Tue, 23 Apr 2024 12:08:43 +0000 (08:08 -0400)]
Merge pull request #15815 from donaldsharp/blackhole_reinstall

lib, zebra: Check for not being a blackhole route

12 months agoRevert "bgpd: fix pointer arithmetic in bgp snmp module" 15819/head
Louis Scalbert [Tue, 23 Apr 2024 09:39:29 +0000 (11:39 +0200)]
Revert "bgpd: fix pointer arithmetic in bgp snmp module"

This reverts commit d9bd9ebbf1c3ab902133e7f47c4b8c073e2df3d4.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoRevert "ospfd: fix some dicey pointer arith in snmp module"
Louis Scalbert [Tue, 23 Apr 2024 09:36:14 +0000 (11:36 +0200)]
Revert "ospfd: fix some dicey pointer arith in snmp module"

This reverts commit 438ef98701e9922e81a451f87ad053268a1a557e.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agobgpd: fix show run of network route-distinguisher 15766/head
Louis Scalbert [Tue, 16 Apr 2024 14:41:51 +0000 (16:41 +0200)]
bgpd: fix show run of network route-distinguisher

Route-distinguisher (RD) is not printed properly in show run:

>  address-family ipv6 vpn
>   network ff01::/64 rd (null) label 7
>   network ff01::/64 rd (null) label 8

ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") merged
bgp_static_set_safi into bgp_static_set but inadvertently omitted the
handling of prd_pretty.

Copy the pretty RD string if available.

> address-family ipv6 vpn
>  network ff01::/64 rd 75:5 label 7
>  network ff01::/64 rd 85:5 label 8

Fixes: ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoMerge pull request #15813 from pguibert6WIND/isis_srv6_backup_endx
Igor Ryzhov [Tue, 23 Apr 2024 08:11:08 +0000 (11:11 +0300)]
Merge pull request #15813 from pguibert6WIND/isis_srv6_backup_endx

isisd: fix renaming backup define for ENDX SID

12 months agoMerge pull request #15536 from ak503/bgp_bfd
Donatas Abraitis [Tue, 23 Apr 2024 08:09:11 +0000 (11:09 +0300)]
Merge pull request #15536 from ak503/bgp_bfd

bgpd: fix disable bfd profile for neighbors.

12 months agoMerge pull request #15717 from pguibert6WIND/vrf_label_allocate_when_necessary
Donatas Abraitis [Tue, 23 Apr 2024 08:08:21 +0000 (11:08 +0300)]
Merge pull request #15717 from pguibert6WIND/vrf_label_allocate_when_necessary

bgpd: do allocate vrf label only when necessary

12 months agoMerge pull request #15750 from piotrsuchy/json_show_ip_prefix_list_fix
Donatas Abraitis [Tue, 23 Apr 2024 08:06:44 +0000 (11:06 +0300)]
Merge pull request #15750 from piotrsuchy/json_show_ip_prefix_list_fix

vtysh, lib: fix 'show ip[v6] prefix-list ... json' JSON display by moving it to vtysh to fix formatting issue

12 months agolib, zebra: Check for not being a blackhole route 15815/head
Donald Sharp [Fri, 19 Apr 2024 16:13:32 +0000 (12:13 -0400)]
lib, zebra: Check for not being a blackhole route

In zebra_interface_nhg_reinstall zebra is checking that the
nhg is a singleton and not a blackhole nhg.  This was originally
done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX,
NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX.  This
was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6.  These
were both possible to be received and maintained from the upper
level protocol for when a route is being recursively resolved.
If we have gotten to this point in zebra_interface_nhg_reinstall
the nexthop group has already been installed at least once
and we *know* that it is actually a valid nexthop.  What the
test is really trying to do is ensure that we are not reinstalling
a blackhole nexthop group( Which is not possible to even be
here by the way, but safety first! ).  So let's change
to test for that instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #15468 from idryzhov/mgmt-native-edit
Christian Hopps [Mon, 22 Apr 2024 09:42:44 +0000 (05:42 -0400)]
Merge pull request #15468 from idryzhov/mgmt-native-edit

mgmtd: add support for native 'edit' operation

12 months agoisisd: fix renaming backup define for ENDX SID 15813/head
Philippe Guibert [Fri, 19 Apr 2024 13:46:20 +0000 (15:46 +0200)]
isisd: fix renaming backup define for ENDX SID

The define has inheritated from a wrong naming in sr-mpls.
Fix this by renaming ISIS_SRV6_LAN_BACKUP to ISIS_SRV6_ADJ_BACKUP.

Fixes: 2566656a6f50 ("isisd: Add data structure for SRv6 Adjacency SIDs")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agovtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh 15750/head
Piotr Suchy [Mon, 15 Apr 2024 19:33:40 +0000 (21:33 +0200)]
vtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh

Json output is not valid for 'show ip[v6] prefix-list ... json' commands,
as it goes through all the running daemons and for each one it calls
'vty_show_prefix_list' creating a new json object. To aggreagate the output
and create a valid json that can be parsed, the commands were moved to vtysh.

Before:
{
  "ZEBRA":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "OSPF":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "BGP":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}

After:
{"zebra":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"ospfd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"bgpd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
}

Signed-off-by: Piotr Suchy <piotrsuchy@proton.me>
12 months agobgpd: Do not reset the session when toggling dynamic capability 15810/head
Donatas Abraitis [Sun, 21 Apr 2024 19:29:32 +0000 (22:29 +0300)]
bgpd: Do not reset the session when toggling dynamic capability

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15738 from idryzhov/bfd-cbit
Donald Sharp [Sun, 21 Apr 2024 14:59:11 +0000 (10:59 -0400)]
Merge pull request #15738 from idryzhov/bfd-cbit

bfdd: fix BFD_GETCBIT

12 months agobgpd: Inherit `capability dynamic` flag from the peer-group
Donatas Abraitis [Sun, 21 Apr 2024 11:19:12 +0000 (14:19 +0300)]
bgpd: Inherit `capability dynamic` flag from the peer-group

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Inherit `capability software-version` flag from the peer-group
Donatas Abraitis [Sun, 21 Apr 2024 11:18:39 +0000 (14:18 +0300)]
bgpd: Inherit `capability software-version` flag from the peer-group

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Inherit `enforce-first-as` flag from the peer-group
Donatas Abraitis [Sun, 21 Apr 2024 11:16:49 +0000 (14:16 +0300)]
bgpd: Inherit `enforce-first-as` flag from the peer-group

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15803 from LabNConsulting/chopps/add-missing-zif-type
Igor Ryzhov [Sat, 20 Apr 2024 18:25:28 +0000 (21:25 +0300)]
Merge pull request #15803 from LabNConsulting/chopps/add-missing-zif-type

yang: add missing `zif-gre` zebra interface type

12 months agoMerge pull request #15798 from opensourcerouting/fix/show_route_map
Donald Sharp [Sat, 20 Apr 2024 13:05:39 +0000 (09:05 -0400)]
Merge pull request #15798 from opensourcerouting/fix/show_route_map

vtysh: Fix `show route-map` command when calling via `do`

12 months agoyang: add missing `zif-gre` zebra interface type 15803/head
Christian Hopps [Sat, 20 Apr 2024 11:59:02 +0000 (07:59 -0400)]
yang: add missing `zif-gre` zebra interface type

This was caught by the grpc_basic test which was receiving an invalid error
result, which was returned b/c inside zebra the libyang code was flagging the
value as invalid for a derived zebra interface type.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: improve coverage no need to modify source/build dir 15801/head
Christian Hopps [Sat, 20 Apr 2024 08:31:03 +0000 (04:31 -0400)]
tests: improve coverage no need to modify source/build dir

- by using symlinks in the rundir (/tmp) into the source/build directory
we avoid needing to copy the *.gcda stat files into the source/build dir.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #15472 from louis-6wind/ipv6-table-direct
Donatas Abraitis [Sat, 20 Apr 2024 08:28:04 +0000 (11:28 +0300)]
Merge pull request #15472 from louis-6wind/ipv6-table-direct

bgpd: add redistribute table-direct command for ipv6-unicast

12 months agotests: update munet to 0.14.0 release
Christian Hopps [Sat, 20 Apr 2024 07:29:03 +0000 (03:29 -0400)]
tests: update munet to 0.14.0 release

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #15792 from opensourcerouting/fix/bgp_send_notification_with_data
Donald Sharp [Fri, 19 Apr 2024 17:25:50 +0000 (13:25 -0400)]
Merge pull request #15792 from opensourcerouting/fix/bgp_send_notification_with_data

bgpd: Include capabilities when sending NOTIFICATION(7)

12 months agovtysh: Fix `show route-map` command when calling via `do` 15798/head
Donatas Abraitis [Fri, 19 Apr 2024 16:17:11 +0000 (19:17 +0300)]
vtysh: Fix `show route-map` command when calling via `do`

Before:

```
ton(config)# do sh route-map
% [ZEBRA] Unknown command: show route-map
% [BGP] Unknown command: show route-map
% [ISIS] Unknown command: show route-map
```

Fixes: 570fdc55fd65899cd4376193e833594af6bca093 ("lib,vtysh: fix show route map JSON output")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agotests: fix BFD C-bit topotest 15738/head
Renato Westphal [Wed, 17 Apr 2024 14:01:23 +0000 (11:01 -0300)]
tests: fix BFD C-bit topotest

When a BFD down notification is received and the C-bit is set in both
directions, any ongoing graceful restart should be aborted and stale
routes removed from the RIB.

This commit updates the `bfd_bgp_cbit_topo3` topotest accordingly to
fix the expected outcomes in the `test_bfd_loss_intermediate` test.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
12 months agobgpd: Include capabilities when sending NOTIFICATION(7) 15792/head
Donatas Abraitis [Thu, 18 Apr 2024 14:37:51 +0000 (17:37 +0300)]
bgpd: Include capabilities when sending NOTIFICATION(7)

RFC5492 says:

This document defines a new Error Subcode, Unsupported Capability.
   The value of this Subcode is 7.  The Data field in the NOTIFICATION
   message MUST list the set of capabilities that causes the speaker to
   send the message.  Each such capability is encoded in the same way as
   it would be encoded in the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: do allocate vrf label only when necessary 15717/head
Philippe Guibert [Tue, 9 Apr 2024 15:09:39 +0000 (17:09 +0200)]
bgpd: do allocate vrf label only when necessary

Today, with the following bgp instance configured, the
local VRF label is allocated even if it is not used.

> router bgp 65500 vrf vrf1
>  address-family ipv4 unicast
>   label vpn export allocation-mode per-nexthop
>   label vpn export auto
>   rd vpn export 444:1
>   rt vpn both 52:100
>   export vpn
>   import vpn

The 'show mpls table' indicates that the 16 label value
is allocated, but never used in the exported prefixes.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   vrf1            -
>  17             BGP   192.168.255.13  -
>  18             BGP   192.0.2.12      -
>  19             BGP   192.0.2.11      -

Fix this by only allocating new label values when really
used. Consequently, only 3 labels will be allocated instead
of previously 4.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   192.168.255.13  -
>  17             BGP   192.0.2.11      -
>  18             BGP   192.0.2.12      -

Fixes: 577be36a41be ("bgpd: add support for l3vpn per-nexthop label")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoMerge pull request #15770 from idryzhov/fix-yang-exit
Jafar Al-Gharaibeh [Thu, 18 Apr 2024 06:33:07 +0000 (01:33 -0500)]
Merge pull request #15770 from idryzhov/fix-yang-exit

lib, zebra: fix exit commands

12 months agoMerge pull request #15780 from donaldsharp/rpki_as_0
Donatas Abraitis [Thu, 18 Apr 2024 06:31:39 +0000 (09:31 +0300)]
Merge pull request #15780 from donaldsharp/rpki_as_0

bgpd: Allow specification of AS 0 for rpki commands

12 months agoMerge pull request #15775 from Shbinging/fix_ospf_vtysh_commands
Donatas Abraitis [Wed, 17 Apr 2024 19:01:20 +0000 (22:01 +0300)]
Merge pull request #15775 from Shbinging/fix_ospf_vtysh_commands

ospfd: fix 'no maximum-paths' 'no write-multiplier'  commands

12 months agoMerge pull request #15771 from idryzhov/fix-keychain-crash
Donald Sharp [Wed, 17 Apr 2024 17:26:36 +0000 (13:26 -0400)]
Merge pull request #15771 from idryzhov/fix-keychain-crash

lib: fix keychain NB crash

12 months agoMerge pull request #15774 from louis-6wind/cleanup-allow-martians
Donatas Abraitis [Wed, 17 Apr 2024 16:17:54 +0000 (19:17 +0300)]
Merge pull request #15774 from louis-6wind/cleanup-allow-martians

bgpd: cleanup references to debug bgp allow-martians

12 months agoMerge pull request #15758 from opensourcerouting/pkg_libyang_versions
Igor Ryzhov [Wed, 17 Apr 2024 15:10:09 +0000 (18:10 +0300)]
Merge pull request #15758 from opensourcerouting/pkg_libyang_versions

debian, redhat, snapcraft: Libyang min version is 2.1.128

12 months agobgpd: Allow specification of AS 0 for rpki commands 15780/head
Donald Sharp [Wed, 17 Apr 2024 13:40:00 +0000 (09:40 -0400)]
bgpd: Allow specification of AS 0 for rpki commands

RFC-7607 specifically calls out the allowed usage
of AS 0 to signal that the a particular address is
not in use and should be guarded against.  Add
the ability to specify this special AS in the rpki
commands.

eva# show rpki  as-number 0
RPKI/RTR prefix table
Prefix                                   Prefix Length  Origin-AS
2.57.180.0                                  22 -  24   0
2.58.144.0                                  22 -  22   0
2.59.116.0                                  24 -  24   0
4.42.228.0                                  22 -  22   0
5.57.80.0                                   22 -  22   0
<snip>
2a13:df87:b400::                            38 -  38   0
2a13:df84::                                 32 -  32   0
2630::                                      16 -  16   0
Number of IPv4 Prefixes: 1166
Number of IPv6 Prefixes: 617

eva# show rpki prefix 2630::/16 0
Prefix                                   Prefix Length  Origin-AS
2630::                                      16 -  16   0
eva#

Fixes: #15778
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoospfd: fix 'no write-multiplier' command 15775/head
Bing Shui [Wed, 17 Apr 2024 10:41:11 +0000 (10:41 +0000)]
ospfd: fix 'no write-multiplier' command

Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
12 months agoospfd: fix 'no maximum-paths' command
Bing Shui [Wed, 17 Apr 2024 08:41:45 +0000 (08:41 +0000)]
ospfd: fix 'no maximum-paths' command

Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
12 months agobgpd: cleanup references to debug bgp allow-martians 15774/head
Louis Scalbert [Wed, 17 Apr 2024 07:51:07 +0000 (09:51 +0200)]
bgpd: cleanup references to debug bgp allow-martians

The debug command was removed in 17e9298e47 ("bgpd: Remove 'debug bgp
allow-martian'")

Cleanup all references to the debug command.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agolib: fix keychain NB crash 15771/head
Igor Ryzhov [Tue, 16 Apr 2024 20:34:20 +0000 (23:34 +0300)]
lib: fix keychain NB crash

Operational data should not be used on validation stage. Move the usage
to apply stage only.

Fixes #15707.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 months agoMerge pull request #15715 from zhou-run/202404092057
Russ White [Tue, 16 Apr 2024 19:51:12 +0000 (15:51 -0400)]
Merge pull request #15715 from zhou-run/202404092057

isisd: The hold time of hello packets on a P2P link does not match the sending interval.

12 months agolib, zebra: fix exit commands 15770/head
Igor Ryzhov [Tue, 16 Apr 2024 19:10:45 +0000 (22:10 +0300)]
lib, zebra: fix exit commands

If a command is not marked as `YANG`-converted, the current command
batching buffer is flushed before executing the command. We shouldn't
flush the buffer when executing an `exit` command. It should only be
flushed if the next command is not `YANG`-converted, which is checked by
the command itself, not the previous `exit`.

Fixes #15706.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 months agozebra: Actually display I/O buffer sizes (part-2) 15769/head
Rajasekar Raja [Tue, 16 Apr 2024 18:33:08 +0000 (11:33 -0700)]
zebra: Actually display I/O buffer sizes (part-2)

An extension of commit-8d8f12ba8e5cd11c189b8475b05539fa8415ccb9

Removing ifdef DEV_BUILD in stream_fifo_push as well to make the 'sh
zebra client' display the current I/O fifo along with max fifo items.

TICKET :#3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
12 months agoMerge pull request #15709 from chiragshah6/fdev2
Mark Stapp [Tue, 16 Apr 2024 15:32:18 +0000 (11:32 -0400)]
Merge pull request #15709 from chiragshah6/fdev2

tools: frr-reload strip interface vrf ctx line

12 months agobgpd: add redistribute table-direct command for ipv6-unicast 15472/head
Philippe Guibert [Mon, 18 Sep 2023 09:24:42 +0000 (11:24 +0200)]
bgpd: add redistribute table-direct command for ipv6-unicast

The 'table-direct' redistribute command is available for ipv4 unicast but
not for ipv6 unicast.

Add the command to ipv6 unicast as well.

Fixes: b6367f8460 ("bgpd: add redistribute table-direct support")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoMerge pull request #15755 from opensourcerouting/fix/check_for_bgpd_rpki
Russ White [Tue, 16 Apr 2024 14:19:26 +0000 (10:19 -0400)]
Merge pull request #15755 from opensourcerouting/fix/check_for_bgpd_rpki

vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI

12 months agoMerge pull request #15733 from opensourcerouting/fix/json_output_for_show_bgp_ipv4_un...
Russ White [Tue, 16 Apr 2024 14:15:20 +0000 (10:15 -0400)]
Merge pull request #15733 from opensourcerouting/fix/json_output_for_show_bgp_ipv4_unicast_json_detail

bgpd: Drop newline in JSON output for `show bgp afi safi json detail`

12 months agoMerge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_ex...
Russ White [Tue, 16 Apr 2024 14:14:41 +0000 (10:14 -0400)]
Merge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd

bgpd: Drop `bgp_network_import_check_exact_cmd` command

12 months agoMerge pull request #15726 from donaldsharp/med_value
Russ White [Tue, 16 Apr 2024 14:14:12 +0000 (10:14 -0400)]
Merge pull request #15726 from donaldsharp/med_value

bgpd: Fix display when using `missing-as-worst`

12 months agoMerge pull request #15616 from pguibert6WIND/srv6_seg_list_sid_order
Russ White [Tue, 16 Apr 2024 11:55:05 +0000 (07:55 -0400)]
Merge pull request #15616 from pguibert6WIND/srv6_seg_list_sid_order

zebra: fix static srv6 segment-list sid order

12 months agoMerge pull request #15572 from donaldsharp/best_path_stuff_sigh
Russ White [Tue, 16 Apr 2024 11:52:09 +0000 (07:52 -0400)]
Merge pull request #15572 from donaldsharp/best_path_stuff_sigh

bgp_process work

12 months agodebian, redhat, snapcraft: Libyang min version is 2.1.128 15758/head
Martin Winter [Tue, 16 Apr 2024 11:40:52 +0000 (13:40 +0200)]
debian, redhat, snapcraft: Libyang min version is 2.1.128

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
12 months agovtysh: Check if bgpd is enabled before installing vtysh commands for RPKI 15755/head
Donatas Abraitis [Tue, 16 Apr 2024 08:56:39 +0000 (11:56 +0300)]
vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15749 from idryzhov/fix-dnssl
Donatas Abraitis [Tue, 16 Apr 2024 04:19:06 +0000 (07:19 +0300)]
Merge pull request #15749 from idryzhov/fix-dnssl

zebra: fix encoded DNSSL length

12 months agozebra: fix encoded DNSSL length 15749/head
Igor Ryzhov [Mon, 15 Apr 2024 20:31:26 +0000 (23:31 +0300)]
zebra: fix encoded DNSSL length

The encoded DNSSL length is not set so the value is missing from RA
packet.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 months agobgpd: Fix display when using `missing-as-worst` 15726/head
Donald Sharp [Thu, 11 Apr 2024 14:46:46 +0000 (10:46 -0400)]
bgpd: Fix display when using `missing-as-worst`

The usage of the `bgp bestpath med missing-as-worst` command
was being accepted and applied during bestpath, but during output
of the routes affected by this it would not give any indication
that this was happening or what med value was being used.

Fixes: #15718
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #15724 from opensourcerouting/fix/ospfd_cleanup_deprecation
Donald Sharp [Mon, 15 Apr 2024 15:29:04 +0000 (11:29 -0400)]
Merge pull request #15724 from opensourcerouting/fix/ospfd_cleanup_deprecation

ospfd, ospf6d: Remove deprecated JSON fields

12 months agoMerge pull request #15728 from raja-rajasekar/rajasekarr/backpressure_fix_coverity
Mark Stapp [Mon, 15 Apr 2024 15:26:54 +0000 (11:26 -0400)]
Merge pull request #15728 from raja-rajasekar/rajasekarr/backpressure_fix_coverity

zebra: backpressure - Fix Null ptr access (Coverity Issue)

12 months agoMerge pull request #15735 from opensourcerouting/feature/maximum-prefix_evpn
Donald Sharp [Mon, 15 Apr 2024 15:24:05 +0000 (11:24 -0400)]
Merge pull request #15735 from opensourcerouting/feature/maximum-prefix_evpn

bgpd: Allow using maximum-prefix for EVPN

12 months agoMerge pull request #15734 from opensourcerouting/fix/compile_truncation
Donald Sharp [Mon, 15 Apr 2024 15:23:15 +0000 (11:23 -0400)]
Merge pull request #15734 from opensourcerouting/fix/compile_truncation

Fix compile warning with -Wformat-truncation

12 months agoMerge pull request #15741 from opensourcerouting/fix/flowspec_redirect_ipv6_community
Donald Sharp [Mon, 15 Apr 2024 15:22:37 +0000 (11:22 -0400)]
Merge pull request #15741 from opensourcerouting/fix/flowspec_redirect_ipv6_community

bgpd: Flow Spec redirect IPv6 Extended Community should be 0x0d

12 months agoMerge pull request #15686 from pguibert6WIND/tcp_non_established_get_port_and_ip
Donatas Abraitis [Mon, 15 Apr 2024 13:40:15 +0000 (16:40 +0300)]
Merge pull request #15686 from pguibert6WIND/tcp_non_established_get_port_and_ip

BGP TCP non established : get port and ip

12 months agoMerge pull request #15743 from anlancs/compile-bgp-vnc
Donatas Abraitis [Mon, 15 Apr 2024 13:33:04 +0000 (16:33 +0300)]
Merge pull request #15743 from anlancs/compile-bgp-vnc

bgpd: fix compile error

12 months agobgpd: fix compile error 15743/head
anlan_cs [Mon, 15 Apr 2024 08:13:20 +0000 (16:13 +0800)]
bgpd: fix compile error

This is happening when configuring with `--disable-bgp-vnc`:
```
./bgpd/bgp_route.c:3342:23: error: unused variable ‘p’ [-Werror=unused-variable]

 3342 |  const struct prefix *p = bgp_dest_get_prefix(dest);
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agobgpd: fix addressing information of non established outgoing sessions 15686/head
Philippe Guibert [Fri, 5 Apr 2024 07:55:05 +0000 (09:55 +0200)]
bgpd: fix addressing information of non established outgoing sessions

When trying to connect to a BGP peer that does not respons, the 'show
bgp neighbors' command does not give any indication on the local and
remote addresses used:

> # show bgp neighbors
>  BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:04,   Waiting for peer OPEN (n/a)
>   Internal BGP neighbor may be up to 255 hops away.
> BGP Connect Retry Timer in Seconds: 120
> Next connect timer due in 117 seconds
> Read thread: off  Write thread: off  FD used: 27

The addressing information (address and port) are only available
when TCP session is established, whereas this information is present
at the system level:

> root@ubuntu2204:~# netstat -pan | grep 192.0.2.1
> tcp        0      0 192.0.2.1:179           192.0.2.150:38060       SYN_RECV    -
> tcp        0      1 192.0.2.1:46526         192.0.2.150:179         SYN_SENT    488310/bgpd

Add the display for outgoing BGP session, as the information in
the getsockname() API provides information for connected streams.
When getpeername() API does not give any information, use the peer
configuration (destination port is encoded in peer->port).

> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:16,   Waiting for peer OPEN (n/a)
> Local host: 192.0.2.1, Local port: 46084
> Foreign host: 192.0.2.150, Foreign port: 179

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: remove useless control checks about TCP connection
Philippe Guibert [Fri, 5 Apr 2024 11:52:27 +0000 (13:52 +0200)]
bgpd: remove useless control checks about TCP connection

When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.

Relaxing the error code for all the returned adressing.

Fixes: 1ff9a340588a ("bgpd: bgpd-fsm-fix.patch")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: Flow Spec redirect IPv6 Extended Community should be 0x0d 15741/head
Donatas Abraitis [Mon, 15 Apr 2024 06:27:07 +0000 (09:27 +0300)]
bgpd: Flow Spec redirect IPv6 Extended Community should be 0x0d

RFC 8956 defines this already clearly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobfdd: fix BFD_GETCBIT
Igor Ryzhov [Sun, 14 Apr 2024 22:57:16 +0000 (01:57 +0300)]
bfdd: fix BFD_GETCBIT

The macro should check C bit, not F bit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 months agoMerge pull request #15592 from pguibert6WIND/fix_srte_color
Donatas Abraitis [Sun, 14 Apr 2024 18:09:47 +0000 (21:09 +0300)]
Merge pull request #15592 from pguibert6WIND/fix_srte_color

bgpd: fix register NHT with appropriate colored ext. community

12 months agoMerge pull request #15612 from sri-mohan1/srib-24-zebra-b
Donatas Abraitis [Sun, 14 Apr 2024 18:06:28 +0000 (21:06 +0300)]
Merge pull request #15612 from sri-mohan1/srib-24-zebra-b

zebra: changes for code maintainability

12 months agoMerge pull request #15731 from anlancs/bgpd-add-gr-fsm
Donatas Abraitis [Sat, 13 Apr 2024 20:19:49 +0000 (23:19 +0300)]
Merge pull request #15731 from anlancs/bgpd-add-gr-fsm

bgpd: adjust checking return value for commands

12 months agotests: Check if maximum-prefix works for EVPN stuff also 15735/head
Donatas Abraitis [Sat, 13 Apr 2024 20:09:12 +0000 (23:09 +0300)]
tests: Check if maximum-prefix works for EVPN stuff also

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Allow using `maximum-prefix` for EVPN
Donatas Abraitis [Sat, 13 Apr 2024 19:54:18 +0000 (22:54 +0300)]
bgpd: Allow using `maximum-prefix` for EVPN

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoospfd: Fix compile warning with `-Wformat-truncation` 15734/head
Donatas Abraitis [Sat, 13 Apr 2024 19:41:43 +0000 (22:41 +0300)]
ospfd: Fix compile warning with `-Wformat-truncation`

ospfd/ospf_sr.c: In function ‘show_sr_node.part.5’:
ospfd/ospf_sr.c:2745:32: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
    snprintf(tmp, sizeof(tmp), "%u", i);
                                ^~
ospfd/ospf_sr.c:2745:31: note: directive argument in the range [0, 2147483646]
    snprintf(tmp, sizeof(tmp), "%u", i);

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoisisd: Fix compile warning with `-Wformat-truncation`
Donatas Abraitis [Sat, 13 Apr 2024 19:40:46 +0000 (22:40 +0300)]
isisd: Fix compile warning with `-Wformat-truncation`

isisd/isis_spf.c: In function ‘show_isis_route_common’:
isisd/isis_spf.c:3034:39: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
     snprintf(key, sizeof(key), "level-%d", level);
                                       ^~
isisd/isis_spf.c:3034:32: note: directive argument in the range [1, 2147483646]
     snprintf(key, sizeof(key), "level-%d", level);
                                ^~~~~~~~~~

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15727 from donaldsharp/evpn_zebra_interactions
Donatas Abraitis [Sat, 13 Apr 2024 19:19:10 +0000 (22:19 +0300)]
Merge pull request #15727 from donaldsharp/evpn_zebra_interactions

Evpn zebra interactions

12 months agobgpd: Drop newline in JSON output for `show bgp afi safi json detail` 15733/head
Donatas Abraitis [Sat, 13 Apr 2024 19:17:01 +0000 (22:17 +0300)]
bgpd: Drop newline in JSON output for `show bgp afi safi json detail`

Before:

```
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "1.1.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "192.168.1.0/24": {
"prefix": "192.168.1.0/24",
"version": "1",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":1,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
} ,"192.168.11.0/24": {
"prefix": "192.168.11.0/24",
"version": "2",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":2,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
}  }  }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Drop `bgp_network_import_check_exact_cmd` command 15732/head
Donatas Abraitis [Sat, 13 Apr 2024 19:10:14 +0000 (22:10 +0300)]
bgpd: Drop `bgp_network_import_check_exact_cmd` command

Not documented, and it's just an alias.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: prompt should be given only for the real change 15731/head
anlan_cs [Fri, 12 Apr 2024 14:56:41 +0000 (22:56 +0800)]
bgpd: prompt should be given only for the real change

Prompt nothing for an empty (and failed) operation.  Take
`bgp graceful-restart` as an example:

Before:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)#
```

After:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
anlan(config-router)#
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agobpgd: adjust return value for the same command
anlan_cs [Fri, 12 Apr 2024 13:57:30 +0000 (21:57 +0800)]
bpgd: adjust return value for the same command

The same command should be accepted, it is an empty operation.  Take
`neighbor <X> graceful-restart-helper` as an example:

Before:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
% The Graceful Restart command used is not valid at this moment.
anlan(config-router)#
```

After:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)#
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agozebra: backpressure - Fix Null ptr access (Coverity Issue) 15728/head
Rajasekar Raja [Fri, 12 Apr 2024 05:27:37 +0000 (22:27 -0700)]
zebra: backpressure - Fix Null ptr access (Coverity Issue)

Fix dereferencing NULL ptr making coverity happy.

Ticket :#3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
12 months agoMerge pull request #15697 from zmw12306/bfd_check_Mflag
Igor Ryzhov [Fri, 12 Apr 2024 13:09:43 +0000 (16:09 +0300)]
Merge pull request #15697 from zmw12306/bfd_check_Mflag

bfdd: Add check for flag Multipoint (M)

12 months agobgpd: Convert int's to bool in a couple of spots 15727/head
Donald Sharp [Thu, 11 Apr 2024 17:47:57 +0000 (13:47 -0400)]
bgpd: Convert int's to bool in a couple of spots

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agobgpd: Increase install/uninstall speed of evpn vpn vni's
Donald Sharp [Thu, 11 Apr 2024 17:28:30 +0000 (13:28 -0400)]
bgpd: Increase install/uninstall speed of evpn vpn vni's

BGP receives notification from zebra about an vpn that
needs to be installed into the evpn tables.  Unfortunately
this function was walking the entirety of evpn tables
3 times.  Modify the code to walk the tree 1 time and
to just look for the needed route types as you go.

This reduces, in a scaled environment, processing
time of the zclient_read function from 130 seconds
to 95 seconds.  For a up / down / up interface
scenario.

Signed-off-by: Rajasekar Raja <rajasekarr@vndia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #15688 from mjstapp/dplane_api_version
Jafar Al-Gharaibeh [Fri, 12 Apr 2024 04:54:02 +0000 (23:54 -0500)]
Merge pull request #15688 from mjstapp/dplane_api_version

lib, zebra: Add a version scheme for the dataplane API

12 months agobfdd: add check for flag M 15697/head
zmw12306 [Sun, 7 Apr 2024 20:19:38 +0000 (16:19 -0400)]
bfdd:  add check for flag M

Signed-off-by: zmw12306 <zmw12306@gmail.com>
12 months agolib: serialize pthread startup 15714/head
Mark Stapp [Tue, 9 Apr 2024 12:51:20 +0000 (08:51 -0400)]
lib: serialize pthread startup

Add a new condition var and mutex to serialize pthread startup.
When a new pthread is started, it will wait very early on for the
parent pthread to permit it to run. This ensures that that the
ordering between parent and child is predictable.

Signed-off-by: Mark Stapp <mjs@cisco.com>
12 months agoMerge pull request #15710 from acooks-at-bda/bugfix/fix-indent-byte-handling
Donald Sharp [Thu, 11 Apr 2024 12:25:15 +0000 (08:25 -0400)]
Merge pull request #15710 from acooks-at-bda/bugfix/fix-indent-byte-handling

tools/indent.py: fix encoded byte stream handling

12 months agoMerge pull request #15661 from routingrocks/master
Donatas Abraitis [Thu, 11 Apr 2024 10:44:00 +0000 (13:44 +0300)]
Merge pull request #15661 from routingrocks/master

pimd:  pim mlag summary should display the down connection status.

12 months agoMerge pull request #15719 from pguibert6WIND/show_bgp_neighbors_extra_line
Donatas Abraitis [Thu, 11 Apr 2024 10:40:06 +0000 (13:40 +0300)]
Merge pull request #15719 from pguibert6WIND/show_bgp_neighbors_extra_line

bgpd: fix 'show bgp neighbors' output

12 months agoospfd, ospf6d: Remove deprecated JSON fields 15724/head
Donatas Abraitis [Thu, 11 Apr 2024 10:34:17 +0000 (13:34 +0300)]
ospfd, ospf6d: Remove deprecated JSON fields

restartSupoort

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agotools: frr-reload strip interface vrf ctx line 15709/head
Chirag Shah [Tue, 9 Apr 2024 00:14:48 +0000 (17:14 -0700)]
tools: frr-reload strip interface vrf ctx line

if frr.conf file contains 'interface x vrf <name> config
it causes protocol (like ospf) neighbor session flap,
as it deletes interface base config line ('interface x') from
running config and readds with 'interface x vrf <name>'
line from frr.conf.
This deletion and readdition of lines leads to neighborship
flaps.

This issue is by product of (PR-10411 | https://github.com/FRRouting/frr/pull/10411)
(commit id: 788a036fdb)
where running config for interface config no loger displays associated
vrf line.

Ticket: #3858146
Testing:

frr.conf
interface swp1.2 vrf vrf1012
ip ospf network point-to-point

running-config:
interface swp1.2
 ip ospf network point-to-point
 exit

Before fix:
frr-reload logs:

2024-04-09 00:28:31,096  INFO: Executed "interface swp1.2  no ip ospf
network point-to-point exit"

 'interface swp1.2 vrf vrf1012\n ip ospf network
 point-to-point\nexit\n',

After fix:
frr-reload strips vrf line, thus no config change between
frr.conf and running config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
12 months agoMerge pull request #15582 from donaldsharp/zebra_rtadv_use_without_init
Donatas Abraitis [Wed, 10 Apr 2024 17:58:35 +0000 (20:58 +0300)]
Merge pull request #15582 from donaldsharp/zebra_rtadv_use_without_init

Zebra rtadv use without init