Commit Graph

35266 Commits

Author SHA1 Message Date
Donatas Abraitis 3bb7b49791
Merge pull request #15794 from chiragshah6/fdev2
tools: fix pim interface config deletion II
2024-04-24 22:33:37 +03:00
Donatas Abraitis 0d0350aef0
Merge pull request #15783 from LabNConsulting/aceelindem/ospf-neighbor-filter
ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interface
2024-04-24 22:30:11 +03:00
Donald Sharp ebe31e1682
Merge pull request #15805 from LabNConsulting/working/lb/nhrp-retry-based-on-config2
nhrp: replace hard coded retry time with value derived from holdtime
2024-04-24 10:16:59 -04:00
Donatas Abraitis 4cedd22253
Merge pull request #15766 from louis-6wind/fix-network-rd
bgpd: fix show run of network route-distinguisher
2024-04-24 14:34:19 +03:00
Donald Sharp 3fa7876304
Merge pull request #15819 from louis-6wind/fix-snmp-oid
bgpd, ospfd: fix non increasing SNMP OID
2024-04-24 07:25:22 -04:00
Chirag Shah da2093ba39 tools: fix frr-reload for no ip msdp peer cmd
no form of 'ip pm msdp peer <> source <>' does not
accept source argument. Stip the 'source <>' part from
config line being deleted via frr-reload.

Ticket: #3874971
Testing:

Config:
vrf blue
 ip msdp peer 1.1.1.1 source 1.1.1.1

frr-reload failure log:
2024-04-23 02:08:32,501  INFO: Failed to execute vrf blue  no ip
msdp peer 1.1.1.1 source 1.1.1.1 exit
2024-04-23 02:08:32,501 ERROR: "vrf blue --  no ip msdp peer 1.1.1.1
source 1.1.1.1 -- exit" we failed to remove this command
2024-04-23 02:08:32,501 ERROR: % Unknown command:  no ip msdp peer
1.1.1.1 source 1.1.1.1

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-04-23 13:40:13 -07:00
Chirag Shah bb52e5ebdc tools: fix pim interface config deletionII
When no ip pim is performed subsequent pim related
configs under the interface also implicitly deleted.
The previous fix was attempting to remove from the same
list which was being integrated.
First collect the lines to remove in separate list
then at the end remove from the original lines_to_del.

commit 623af04e1c does not work properly if tries to delete
an entry from existing list which is being walked on.

Ticket: #3869779

Testing done:

frr.conf:
no interface config

running-config:
--------------
interface swp1
ip pim
ip pim active-active
ip pim allow-rp rp-list sample
ip pim bfd
ip pim use-source 1.1.1.1
ip multicast boundary oil test
exit

frr-reload log pointing only no ip pim config
is removed under interface:
2024-04-18 18:44:37,202  INFO: "frr defaults datacenter" cannot be removed
2024-04-18 18:44:37,202  INFO: "service integrated-vtysh-config" cannot be removed
2024-04-18 18:44:37,504  INFO: Executed "interface swp1  no ip pim exit"
2024-04-18 18:44:37,505  INFO: /var/run/frr/reload-YHS51E.txt content

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-04-23 13:40:07 -07:00
Mark Stapp 1c49f93b5f
Merge pull request #15769 from raja-rajasekar/rajasekarr/backpressure_display_i_o_buf
zebra: Actually display I/O buffer sizes (part-2)
2024-04-23 13:01:35 -04:00
Donald Sharp 99ae329047
Merge pull request #15801 from LabNConsulting/chopps/new-munet
Improve coverage functionality
2024-04-23 12:58:48 -04:00
Donald Sharp d7a33de67f
Merge pull request #15810 from opensourcerouting/fix/enforce_first_as_bgp_peer-group
bgpd: Inherit some peer flags from the peer-group
2024-04-23 12:57:24 -04:00
Donald Sharp b8f0be9ddd
Merge pull request #15714 from mjstapp/sync_pthread_startup
lib: serialize pthread startup
2024-04-23 12:55:27 -04:00
Lou Berger cffec3cbad nhrp: replace hard coded retry time with value derived from holdtime
Signed-off-by: Lou Berger <lberger@labn.net>
2024-04-23 11:51:33 -04:00
Mark Stapp a4e60f3399
Merge pull request #15815 from donaldsharp/blackhole_reinstall
lib, zebra: Check for not being a blackhole route
2024-04-23 08:08:43 -04:00
Louis Scalbert c1124a44c3 Revert "bgpd: fix pointer arithmetic in bgp snmp module"
This reverts commit d9bd9ebbf1.

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>
2024-04-23 11:39:29 +02:00
Louis Scalbert c7895ba320 Revert "ospfd: fix some dicey pointer arith in snmp module"
This reverts commit 438ef98701.

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>
2024-04-23 11:36:14 +02:00
Louis Scalbert 3d3a138f5a 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>
2024-04-23 10:39:21 +02:00
Igor Ryzhov 166a82ca6a
Merge pull request #15813 from pguibert6WIND/isis_srv6_backup_endx
isisd: fix renaming backup define for ENDX SID
2024-04-23 11:11:08 +03:00
Donatas Abraitis bb7b0ff01f
Merge pull request #15536 from ak503/bgp_bfd
bgpd: fix disable bfd profile for neighbors.
2024-04-23 11:09:11 +03:00
Donatas Abraitis 0a6f661eae
Merge pull request #15717 from pguibert6WIND/vrf_label_allocate_when_necessary
bgpd: do allocate vrf label only when necessary
2024-04-23 11:08:21 +03:00
Donatas Abraitis 5738263065
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
2024-04-23 11:06:44 +03:00
Donald Sharp 29c1ff446e 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>
2024-04-22 10:44:55 -04:00
Christian Hopps 7f7bcb1ffa
Merge pull request #15468 from idryzhov/mgmt-native-edit
mgmtd: add support for native 'edit' operation
2024-04-22 05:42:44 -04:00
Philippe Guibert ad874c7d3b 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: 2566656a6f ("isisd: Add data structure for SRv6 Adjacency SIDs")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-22 10:00:07 +02:00
Piotr Suchy 0a17289a3b 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>
2024-04-21 23:40:06 +02:00
Donatas Abraitis 83109e3f66 bgpd: Do not reset the session when toggling dynamic capability
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 22:29:32 +03:00
Donald Sharp 7ba58e97ff
Merge pull request #15738 from idryzhov/bfd-cbit
bfdd: fix BFD_GETCBIT
2024-04-21 10:59:11 -04:00
Donatas Abraitis 70631acbb8 bgpd: Inherit `capability dynamic` flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:19:12 +03:00
Donatas Abraitis 9c9f9ce3c1 bgpd: Inherit `capability software-version` flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:18:39 +03:00
Donatas Abraitis 6486afe8d5 bgpd: Inherit `enforce-first-as` flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:16:49 +03:00
Igor Ryzhov 99a723e5a8
Merge pull request #15803 from LabNConsulting/chopps/add-missing-zif-type
yang: add missing `zif-gre` zebra interface type
2024-04-20 21:25:28 +03:00
Donald Sharp 0ff8034e9a
Merge pull request #15798 from opensourcerouting/fix/show_route_map
vtysh: Fix `show route-map` command when calling via `do`
2024-04-20 09:05:39 -04:00
Christian Hopps 74fb4056cb 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>
2024-04-20 08:04:00 -04:00
Christian Hopps 36b7c68111 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>
2024-04-20 04:31:03 -04:00
Donatas Abraitis 0605ec9f84
Merge pull request #15472 from louis-6wind/ipv6-table-direct
bgpd: add redistribute table-direct command for ipv6-unicast
2024-04-20 11:28:04 +03:00
Christian Hopps 44f5916d70 tests: update munet to 0.14.0 release
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-04-20 03:29:03 -04:00
Donald Sharp 855fa82f37
Merge pull request #15792 from opensourcerouting/fix/bgp_send_notification_with_data
bgpd: Include capabilities when sending NOTIFICATION(7)
2024-04-19 13:25:50 -04:00
Donatas Abraitis 9b8f18a66c 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: 570fdc55fd ("lib,vtysh: fix show route map JSON output")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-19 19:17:11 +03:00
Renato Westphal 790c207fa9 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>
2024-04-18 18:28:36 -03:00
Acee Lindem 0ccad8a2b0 ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interface
This commit adds the capabiity to filter OSPF neighbors using a
prefix-list with rules matching the neighbor's IP source address.
Configuration, filtering, immediate neighbor pruning, topo-tests,
and documentation are included. The command is:

     ip ospf neighbor-filter <prefix-list> [A.B.C.D]

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-18 15:32:58 +00:00
Donatas Abraitis 79cf6512f4 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>
2024-04-18 17:44:51 +03:00
Philippe Guibert 8b27521cfa 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: 577be36a41 ("bgpd: add support for l3vpn per-nexthop label")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-18 14:55:25 +02:00
Jafar Al-Gharaibeh 8e7fb950c1
Merge pull request #15770 from idryzhov/fix-yang-exit
lib, zebra: fix exit commands
2024-04-18 01:33:07 -05:00
Donatas Abraitis 8ea02843dc
Merge pull request #15780 from donaldsharp/rpki_as_0
bgpd: Allow specification of AS 0 for rpki commands
2024-04-18 09:31:39 +03:00
Donatas Abraitis b2263bcff6
Merge pull request #15775 from Shbinging/fix_ospf_vtysh_commands
ospfd: fix 'no maximum-paths' 'no write-multiplier'  commands
2024-04-17 22:01:20 +03:00
Donald Sharp e145b0c79f
Merge pull request #15771 from idryzhov/fix-keychain-crash
lib: fix keychain NB crash
2024-04-17 13:26:36 -04:00
Donatas Abraitis e9a3326d6a
Merge pull request #15774 from louis-6wind/cleanup-allow-martians
bgpd: cleanup references to debug bgp allow-martians
2024-04-17 19:17:54 +03:00
Igor Ryzhov 117532f0be
Merge pull request #15758 from opensourcerouting/pkg_libyang_versions
debian, redhat, snapcraft: Libyang min version is 2.1.128
2024-04-17 18:10:09 +03:00
Donald Sharp cfee4e3cf5 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>
2024-04-17 09:42:26 -04:00
Bing Shui 913567c0e0 ospfd: fix 'no write-multiplier' command
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
2024-04-17 10:41:11 +00:00
Bing Shui d249a7c9f5 ospfd: fix 'no maximum-paths' command
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
2024-04-17 10:39:02 +00:00