Commit Graph

35246 Commits

Author SHA1 Message Date
Louis Scalbert
62913cb15d topotests: add bgp_nexthop_mp_ipv4_6 test
Add bgp_nexthop_mp_ipv4_6 topotest to test to nexhop value with
MP-BGP IPv4 and IPv6 on IPv4 peering. The test has route-reflector,
route-server, iBGP and eBGP peers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
424fe0bf80 bgpd: fix sending ipv6 local nexthop if global present
bgpd keeps on advertising IPv6 prefixes with a IPv6 link-local nexthop
after a valid IPv6 global appears.

At bgpd startup, the IPv6 global is announced by zebra after the
link-local. Only the link-local is advertised. Clearing the BGP sessions
make the global to to be announced.

Update the nexthops with the global IPv6 when available.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:26:49 +02:00
Louis Scalbert
b083885198 bgpd: log new ipv6 global in bgp_interface_address_add
Log new IPv6 global address in bgp_interface_address_add

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:26:49 +02:00
Louis Scalbert
778e0df87b bgpd: reduce bgp_interface_address_add indentation
Reduce bgp_interface_address_add indentation

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:26:49 +02:00
Louis Scalbert
8599fe2b5e bgpd: optimize bgp_interface_address_add
Move common checks outside of the loop.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:26:49 +02:00
Louis Scalbert
d346d1ac41 Revert "bgpd: fix 6vpe nexthop"
This reverts commit 0325116a27.

It was causing an issue where a nexthop for IPv6 over an IPv4 session
was always rewritten to an IPv4-mapped IPv6 address even when a valid
IPv6 global address was existing.

Link: https://github.com/FRRouting/frr/issues/15610
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:26:49 +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
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
Donald Sharp
7ba58e97ff
Merge pull request #15738 from idryzhov/bfd-cbit
bfdd: fix BFD_GETCBIT
2024-04-21 10:59:11 -04: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
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
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
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
Louis Scalbert
bc529cf92b 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>
2024-04-17 09:55:54 +02:00
Igor Ryzhov
5f018a36d5 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>
2024-04-16 23:34:20 +03:00
Russ White
5ef6a2bb54
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.
2024-04-16 15:51:12 -04:00
Igor Ryzhov
57811a53ba 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>
2024-04-16 22:18:01 +03:00
Mark Stapp
84d1fb19e2
Merge pull request #15709 from chiragshah6/fdev2
tools: frr-reload strip interface vrf ctx line
2024-04-16 11:32:18 -04:00
Philippe Guibert
2a384f14c1 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>
2024-04-16 15:12:58 +00:00
Russ White
314e9f9803
Merge pull request #15755 from opensourcerouting/fix/check_for_bgpd_rpki
vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI
2024-04-16 10:19:26 -04:00
Russ White
0719f6f513
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`
2024-04-16 10:15:20 -04:00
Russ White
ee77989ffa
Merge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop `bgp_network_import_check_exact_cmd` command
2024-04-16 10:14:41 -04:00
Russ White
057d56ee29
Merge pull request #15726 from donaldsharp/med_value
bgpd: Fix display when using `missing-as-worst`
2024-04-16 10:14:12 -04:00
Russ White
13d598712a
Merge pull request #15616 from pguibert6WIND/srv6_seg_list_sid_order
zebra: fix static srv6 segment-list sid order
2024-04-16 07:55:05 -04:00
Russ White
1c043440ea
Merge pull request #15572 from donaldsharp/best_path_stuff_sigh
bgp_process work
2024-04-16 07:52:09 -04:00
Martin Winter
81d63e476a
debian, redhat, snapcraft: Libyang min version is 2.1.128
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2024-04-16 13:45:12 +02:00
Donatas Abraitis
d9d6db4582 vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-16 11:56:39 +03:00
Donatas Abraitis
f26a44f8dc
Merge pull request #15749 from idryzhov/fix-dnssl
zebra: fix encoded DNSSL length
2024-04-16 07:19:06 +03:00
Igor Ryzhov
8d6f7a4397 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>
2024-04-15 23:31:26 +03:00
Donald Sharp
bc9885b22e 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>
2024-04-15 12:33:53 -04:00
Donald Sharp
572b6f3145
Merge pull request #15724 from opensourcerouting/fix/ospfd_cleanup_deprecation
ospfd, ospf6d: Remove deprecated JSON fields
2024-04-15 11:29:04 -04:00