Commit Graph

35483 Commits

Author SHA1 Message Date
Chirag Shah
439c6f70b5 tools: Handle seq num for BGP as-path in frr-reload.py
If frr.conf has bgp as-path access-list clause without sequence number
then upon performing frr-rleoad, the running config clause with sequence
number will always be deleted and the new ones without sequence will
be re-added.
This could lead to blackholing until the config gets reapplied.

Testing:

frr.conf:
bgp as-path access-list important_internet_bgp_as_numbers permit _16509_

Running config:
bgp as-path access-list important_internet_bgp_as_numbers seq 5 permit
_16509_
!

Before fix
Upon frr-reload it deletes and readd line as without seq

2024-04-26 03:16:45,772  INFO: Executed "no bgp as-path access-list
important_internet_bgp_as_numbers seq 5 permit _16509_"

'bgp as-path access-list important_internet_bgp_as_numbers permit
_16509_\n'

After fix:
no form is not executed and no delta determine between frr.conf
and running-config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-04-25 20:30:12 -07:00
Andrew Cooks
89a2e4d825 lib: replace deprecated ares_gethostbyname
c-ares has deprecated ares_gethostbyname() in version 1.28.0
Replace it with ares_getaddrinfo().

This fixes a build error on Fedora 40.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-04-26 06:28:44 +10:00
Donald Sharp
b4c64b3a39 bgpd: Remove unused addition found in clang
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-25 14:45:32 -04:00
Donald Sharp
6214396306 bgpd: Explain Better admin w/ redistribution a bit better.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-25 14:17:46 -04:00
Acee Lindem
3b75723061 ospfd: OSPFAPI Server options to limit to local connections and per-instance TCP
This commit include OSPFAPI Server options to:

 1. Allow specification of the OSPFAPI server local address.
 2. Allow different OSPFAPI server TCP ports to be specified for different
    OSPF instances in /etc/services.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-25 16:20:50 +00:00
David Lamparter
b472b024ea yang: ietf-netconf-acm needs to be in libfrr
ietf-key-chain depends on ietf-netconf-acm, and lib/ code sets up the
former, so ietf-netconf-acm needs to be embedded in the libfrr too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 15:06:14 +02:00
Philippe Guibert
f6e58d26f6 zebra, sharpd: add srv6 End.DX6 support
Add the support for adding DX6 behavior into netlink layer of zebra.
Add the necessary test in sharpd.

> ubuntu2204# sharp install seg6local-routes 1:1::1:2 nexthop-seg6local loop1 End_DX6 4:4::4:6 1
> ubuntu2204# do show ipv6 route
> [..]
> D>* 1:1::1:2/128 [150/0] is directly connected, loop1, seg6local End.DX6 nh6 4:4::4:6, weight 1, 00:00:03

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-25 13:54:25 +02:00
David Lamparter
a6040ba1f5
Merge pull request #15833 from mjstapp/fix_vtysh_bgp_defs 2024-04-25 13:10:43 +02:00
David Lamparter
52734fc8e5 ospf6d: accept CLI no for point-to-multipoint
`point-to-multipoint` was missing on the removal variant of this CLI
command.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:20:27 +02:00
David Lamparter
d7f54c4d56 ospf6d: force recalculate on interface_up
interface_up also handles changes to the interface type, i.e. broadcast
to ptp to ptmp.  Connected routes for these are different and must be
readvertised, which is done in ospf6_interface_recalculate_cost() - but
only if the cost changed.  Use the force variant here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:18:08 +02:00
David Lamparter
4aa200c7c5 ospf6d: fix loopback/ptp/ptmp conn. route checks
The code emitting connected routes was checking against the interface
state (which can also be lo/ptp/ptmp) rather than the interface type.
This was causing wrong IA prefixes for connected routes getting put up
out if the interface was down intermittently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:16:35 +02:00
David Lamparter
b47657600b ospf6d: fix DEFUN formatting wrecked by clang
clang-format doesn't understand `DEFUN` and formats it rather ugly.
Standard approach was to skip these in clang-format, which hasn't
happened here sadly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 11:45:19 +02:00
Andrew Cooks
4540fa0a3e lib: replace deprecated ares_process()
ares_process(...) has been deprecated.
Replace it with ares_process_fd(...)

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-04-25 17:54:51 +10:00
Vincent JARDIN
f30275d05b docs: libs install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00
Vincent JARDIN
b9161936af docs: sysrepo install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00
Vincent JARDIN
e779a5fd7e docs: libyang install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00
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
anlan_cs
245b244695 doc: clean up a few commands for isis
Remove a few obsoleted isis commands based on code.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-24 20:36:47 +08:00
Mark Stapp
3a59d4f984 lib,bgpd,vtysh: move bgp vty defines to lib
Stop including a bgp header file from vtysh; move a couple
of cli string defines to a library header.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-24 08:23:12 -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
Donatas Abraitis
1ce626aea6 vtysh: Show ip ospf network ... even if it's not the same as the interface type
ospfv3 shows this unconditionally, and ospfv2 does not show `ip ospf network ...` if the type of the interface matches the specified network.

Fixes: https://github.com/FRRouting/frr/issues/15817

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-23 17:13:46 +03:00
Philippe Guibert
a08922256a isis, lib: add isis srv6 capability to ls_node
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:27:01 +02:00
Philippe Guibert
196f0d69fa isisd, lib: add link state support for srv6 adjacencies
Add support for endx_lan and endx adjacency.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:27:01 +02:00
Philippe Guibert
03d2ad01a4 lib: fix srv6 locator flags propagated to isis
When usid is not used, the isis_srv6_topo1 test does not work.
The SID prefix allocated by isis is different when the usid
flags is set or not. When the flags is not transmitted to isis,
the SID allocated is supposed to be a 128 bit mask length SID,
which is not what the isis_srv6_topo1 test is supposed to obtain.

Fix this by exchanging the flags locator value in the zclient api.

Fixes: 9b7491e1fc ("lib: Add support for flags to the SRv6 locator")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:25:48 +02:00
Philippe Guibert
5e7bb79f11 topotests: lib, fix filter out "At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU" message
When testing SNMP service on FRR, the following error message may
appear on some distros.

> # snmpwalk -v2c -c public .1.3.6 1.1.1.1 <OID>
> Bad operator (INTEGER): At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU
> [..then result ..]
>

The error message is due to the /etc/snmp/snmp.conf file. By default, this
file is used by both snmp server and client side. The net-snmp MIB parsing
routing loads MIBS, to bind oids with the naming scheme used by the MIBS.

> # cat /etc/frr/snmp.conf
> [snmp]
> mibs +ALL
>

A potential fix would consist in modifying the SNMPv2-PDU.mib file: the
problem is known on ubuntu distros, as the snmp-mibs-downloader package
has not updated the SNMPv2-PDU.mib file.

The choice is done to not modify the original distro where the test is run
on. Fix the topotests by ignoring the 'SNMPv2-PDU line 73" error message, and
keep the other error messages that may happen, for instance, when an
unknown oid name value is requested.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:24:51 +02: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
f1b8364ab3 topotests: update bgp_vrf_leaking_5549_routes
Before the patch-set, ce1 was sending an IPv6 Link-local as global and
link-local nexthop to pe1.

Set bgp_vrf_leaking_5549_routes in accordance with the previous fixes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
5dd731af84 bgpd: prefer link-local to a ipv4-mapped ipv6 global
When a peer sends an IPv4-mapped IPv6 global and a IPv6 link-local
nexthop, prefer the link-local unless a route-map tells to use the
global.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
fc5a738409 bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop
The code was expected that no IPv6 global address was present but the
previous commit was replacing nexthop.v6global by the link-local address
instead of un-setting it in case of removal of the IPv6 global.

Set also ipv4-mapped ipv6 address as nexthop when a link-local is found
and it is an ipv4 prefix over ipv6 nexthop.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
04c220bedb tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6
Test ipv6 global removal in bgp_nexthop_mp_ipv4_6

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
2de4dfc97a bgpd: fix "used" json key on link-local nexthop
When a peer has no IPv6 global address to send as nexthop, it sends the
IPv6 link-local instead as global. "show bgp ipv6 json" displays the
same address in global and link-local scopes.

> "nexthops": [
>   {
>     "ip": "fe80::a495:38ff:fea6:6ea3",
>     "afi": "ipv6",
>     "scope": "global",
>     "used": true
>   },
>   {
>     "ip": "fe80::a495:38ff:fea6:6ea3",
>     "afi": "ipv6",
>     "scope": "link-local"
>   }
> ]

However, "used" key is set on the global nexthop but not in link-local.
It is correct but it makes difficult to test JSON to expect the usage of
a link-local. The contrary is also correct.

Set "used" key on the link-local nexhop instead to facilitate the tests.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
ee0378cdbb bgpd: fix removing ipv6 global nexhop
When the IPv6 global is removed on an interface towards a peer, the
IPv6 nexthop global that is sent is a IPv4-mapped IPv6 address. It
should be the link-local.

At removal, replace the global by the next global address or the
link-local as last resort.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
fc1dd2e506 bgpd: optimize bgp_interface_address_del
Move common checks outside of the loop.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
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