Commit Graph

3454 Commits

Author SHA1 Message Date
Russ White
54c2d327d3
Merge pull request #12261 from cscarpitta/srv6-encap-src-addr
zebra: Add the support of the Source Addr param of the SRv6 Encapsulation
2024-01-02 10:37:34 -05:00
Christian Hopps
7e6595698b
lib: fix specific entry queries
- fix key leaf queries
- fix specific list entry with non-key leaf top element

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-02 09:47:15 +00:00
Christian Hopps
f7258386db tests: add mgmt_oper topotest
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:37:18 +00:00
Christian Hopps
2bb115fd78 tests: client testing
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:17:24 +00:00
Christian Hopps
b8b5290105 lib: fixes required after rebasing
lib: fix checkpatch warnings
lib: darr: disable check
mgmtd: fix initialization

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:17:24 +00:00
Christian Hopps
f3d6edc7ee lib: darr: add new access and str functions
- darr_last(), and darr_strdup_cap().
- strcat, strdup, strlen, strnul equivs.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
1bb6f21208 tests: add debugs and count in static_simple test
Also add option to use unified config.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Donald Sharp
1aa6c5ec23 tests: Stop some warning messages on test runs
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 10:24:23 -05:00
Donald Sharp
7477d8732f tests: Auto generate support bundle when a test fails
Tests can fail, let's be proactive and gather up a support
bundle when they fail.  It will help diagnose the problem
to some extent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 10:22:22 -05:00
Xiao Liang
4538247c99 tests: Check for 0.0.0.0/1 in bgp_default_route
Ensure that 0.0.0.0/1 route can be advertised along with
default-originate.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2023-12-18 15:14:33 +08:00
Donatas Abraitis
a912f8fab7
Merge pull request #15015 from donaldsharp/test_ospf_suppress_fa_cleanup
tests: ospf_suppress_fa sleeps, convert to run_and_expect
2023-12-15 07:01:27 +02:00
Donald Sharp
db4bdf7a3a
Merge pull request #15023 from opensourcerouting/fix/drop_redundant_vrf_name
bgpd: Drop redundant VRF name printing for `show bgp summary`
2023-12-14 20:26:52 -05:00
Olivier Dugeon
55ad785753 tests: Update OSPF TE topotests
The OSPF TE topotest is using switches to interconnect router. During the test,
interfaces are shutdown on some routers to simulate link failure and check that
the TED is correctly updated. However, the switche between router avoid the
detection by the neighbor router that the interface is down i.e. the interface
line remains up as it is conneted to the switch and not to the router.

This patch update the tested topology by removing the switch and connect
directly the router excepted the inter AS link on R3. Interface are also
renamed accordingly.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-12-14 18:39:16 +01:00
Donald Sharp
48df84a044 tests: ospf_suppress_fa sleeps, convert to run_and_expect
The test_ospf_suppres_fa.py script is using straight
up sleeps before testing that the next step worked properly.
On a unloaded test system this will work 100% of the time
on a loaded test system this will have random failures.
Convert the test to use run_and_expect and give each
section of the test 30 seconds to get to the next state
appropriately instead of 10.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-14 10:42:45 -05:00
Carmine Scarpitta
e12987d1b3 tests: Add topotests for SRv6 encap source address
Add a new topotest `srv6_encap_src_addr` which verifies that the
`source-address` command works properly.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-12-14 14:58:35 +01:00
Donatas Abraitis
f97abbdc69 tests: Adopt topotests for show bgp summary non-JSON output
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-14 15:09:39 +02:00
Louis Scalbert
73ce39c443 topotests: tmp fix delay in bgp_peer_type_multipath_relax
Workaround an issue in bgp_peer_type_multipath_relax.

Link: https://github.com/FRRouting/frr/issues/14895
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 11:39:32 +01:00
Louis Scalbert
a54d18cb1c topotests: remove python2 support
Remove python2 support

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
5d1d44d18a topotests: convert bgp_ecmp_topo1 to python3
Convert bgp_ecmp_topo1 to python3

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
75a849fc0d topotests: convert exabgp scripts to python3
Convert exabgp scripts to python3

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
5383945609 topotests: cleanup bgp_peer_type_multipath_relax
Cleanup bgp_peer_type_multipath_relax to make it more readable.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
da8333d9bb topotests: convert bgp_peer_type_multipath_relax to exabgp 4
Convert bgp_peer_type_multipath_relax to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
5533f18dc6 topotests: convert bgp_prefix_sid2 to exabgp 4
Convert bgp_prefix_sid2 to exabgp 4

Do not advertise prefixes to exabgp to avoid an issue where exabgp
resets the bgp session with the following notification:

> invalid ipv6 mpls-vpn next-hop length 48 expected 24 or 40

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
811ad11a7e topotests: convert bgp_prefix_sid to exabgp 4
Convert bgp_prefix_sid to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
cfcad6fd99 topotests: convert bgp_vrf_netns to exabgp 4
Convert bgp_vrf_netns to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
9598967a0d topotests: convert bgp_vrf_md5_peering to exabgp 4
Convert bgp_vrf_md5_peering to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
d228f6a564 topotests: convert bgp_multiview_topo1 to exabgp 4
Convert bgp_multiview_topo1 to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Louis Scalbert
bc149fee3d topotests: convert bgp_ecmp_topo1 to exabgp 4
Convert bgp_ecmp_topo1 to exabgp 4

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Louis Scalbert
c7e73e9087 topotests: create exabgp cli fifo
Create reate exabgp cli fifo even it is not used in topotests to avoid
this error message:

> 16:21:42 | 2290205 | cli             | could not find the named pipes (exabgp.in and exabgp.out) required for the cli
> 16:21:42 | 2290205 | cli             | we scanned the following folders (the number is your PID):
> 16:21:42 | 2290205 | cli control     |  - /run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /run/0/
> 16:21:42 | 2290205 | cli control     |  - /run/
> 16:21:42 | 2290205 | cli control     |  - /var/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /var/run/0/
> 16:21:42 | 2290205 | cli control     |  - /var/run/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/0/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/0/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/
> 16:21:42 | 2290205 | cli control     | please make them in one of the folder with the following commands:
> 16:21:42 | 2290205 | cli control     | > mkfifo //run/exabgp.{in,out}
> 16:21:42 | 2290205 | cli control     | > chmod 600 //run/exabgp.{in,out}

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Louis Scalbert
a1b8727ccd topotests: log exabgp by default
Log exabgp by default in /tmp/topotests/<testname>/<peername>/exabgp.log
Level is INFO.

Note that in case the configuration syntax is invalid, exabgp does not
log into the file and exits at startup. You can check a configuration
syntax by running:

> exabgp <exabgp.cfg>

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Louis Scalbert
c040637e97 topotests: use exabgp 4.2.11 in ci
Use exabgp 4.2.11 in CI instead.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Louis Scalbert
9589fb300d topotests: look for python3 exabgp
Look for python3 exabgp instead of python2.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Louis Scalbert
92c1a102e4 topotests: require exabgp version >= 4.2.11
Require exabgp >= 4.2.11 to allow to newer version to run exabgp
topotests. Next commits will adapt the exabgp topotests when needed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:29 +01:00
Donald Sharp
5be4ee9634 bgpd: Have show bgp vrf all ipv4 uni summ display vrf NAME
The vrf name was not being displayed in this output.
New output:

eva# show bgp vrf all ipv4 uni summ
BGP router identifier 0.0.0.0, local AS number 99 VRF RED vrf-id 14
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.119.1   4          0         0         0        0    0    0    never       Active        0 N/A

Total number of neighbors 1
BGP router identifier 0.0.0.0, local AS number 99 VRF GREEN vrf-id 15
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.119.1   4          0         0         0        0    0    0    never       Active        0 N/A

Total number of neighbors 1
BGP router identifier 192.168.122.1, local AS number 99 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.119.1   4          0         0         0        0    0    0    never       Active        0 N/A

Total number of neighbors 1
BGP router identifier 0.0.0.0, local AS number 99 VRF GrEEn vrf-id -1
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.119.1   4          0         0         0        0    0    0    never         Idle        0 N/A

Total number of neighbors 1
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-12 18:26:14 -05:00
Russ White
39ab18f1fd
Merge pull request #14966 from opensourcerouting/fix/bgpd_route-map_default_originate_peer-group
tests: Check if default-originate works combined with peer-groups + route-maps
2023-12-12 10:54:34 -05:00
Rafael Zalamena
9f1a7ba972 topotests: remove obsolete OSPFv3 area config
Don't use 'interface WORD area A.B.C.D' for enabling OSPFv3 areas on
interfaces and instead use the standardized 'ipv6 ospf6 area A.B.C.D'.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-12-08 10:51:32 -03:00
Donatas Abraitis
8009047698 tests: Check if default-originate works combined with peer-groups + route-maps
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-08 12:41:44 +02:00
Donatas Abraitis
6b79b560ab
Merge pull request #14889 from fdumontet6WIND/snmpv2
bgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable
2023-12-08 06:55:52 +02:00
Donald Sharp
2df4683af0
Merge pull request #14936 from LabNConsulting/chopps/mgmt-dbg-improve
Chopps/mgmt dbg improve
2023-12-07 11:20:54 -05:00
Donatas Abraitis
24869b4a99
Merge pull request #14957 from donaldsharp/zebra_noprefixroute
Add ability to handle `noprefixroute` to zebra
2023-12-07 15:24:10 +02:00
Donald Sharp
0d5c5472c9 tests: Add a noprefixroute test
Add a simple test case to ensure that the noprefixroute
code stays working in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-06 09:27:52 -05:00
Rafael Zalamena
cad5ee56be
Merge pull request #14922 from louis-6wind/fix-bfd-static-source
staticd: fix changing to source auto in bfd monitor
2023-12-06 09:51:32 -03:00
Chirag Shah
64745d413c pbrd: fix map seq installed flag in json
Ticket:#3638598
Testing:

Post fix:
tor-2# show pbr map json
[
  {
    "name":"global-vrf-PBR-map",
    "valid":true,
    "policies":[
      {
        "id":1,
        "sequenceNumber":10,
        "ruleNumber":309,
        "vrfUnchanged":false,
        "installed":true,   <<<< now display correct value
        "installedReason":"Valid",
        "vrfName":"sym_1",
        "matchSrc":"10.1.200.0\/24",
        "matchDst":"10.6.200.0\/24"
      }
    ]
  }

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-12-05 11:30:50 -08:00
Christian Hopps
38b44aeeb2 tests: client testing
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-05 13:39:40 -05:00
Donald Sharp
83018e2178
Merge pull request #14934 from LabNConsulting/chopps/new-munet-0.13.10
tests: import munet 0.13.10
2023-12-05 13:24:39 -05:00
Donald Sharp
ad80021260
Merge pull request #14920 from LabNConsulting/chopps/rr-support
tests: add support for running things under `rr`.
2023-12-05 11:42:10 -05:00
Russ White
0a79e117d6
Merge pull request #12600 from donaldsharp/local_routes
*: Introduce Local Host Routes to FRR
2023-12-05 11:00:44 -05:00
Francois Dumontet
869047f150 tests: improve test bgp_snmp_bgp4v2mib for snmp multi path support
multi path support by snmp implies change in configuration and expected
tests results.

ipv6 trap test output is now ordered to avoid radom result due to
timeline.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-05 15:51:52 +01:00
Christian Hopps
6f64ebee1b tests: import munet 0.13.10
- Import 0.13.10 which adds watched logs feature, among others.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-04 07:03:49 -05:00
Christian Hopps
477b56106b tests: add support for running things under rr.
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-01 11:44:22 -05:00
Louis Scalbert
94640da234 topotests: test wrong bfd source in bfd_topo3
Test setting a wrong bfd source and restore the source auto parameter.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-01 14:09:00 +01:00
Louis Scalbert
8f5bf65f26 topotests: redispatch tests in bfd_topo3
Redispatch tests in bfd_topo3 in order to prepare next commit.
Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-01 14:09:00 +01:00
Donatas Abraitis
36547f400e
Merge pull request #9012 from dlqs/lua-poly
Refactor decoder for Lua hook system
2023-11-29 15:14:46 +02:00
Donatas Abraitis
fc8a07433f
Merge pull request #14886 from LabNConsulting/aceelindem/ospf-link-local-fix
ospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruption
2023-11-29 10:36:30 +02:00
Acee
5993c4aef9 ospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruption
1. When an OSPF interface is deleted, remove the references in link-local
     LSA. Delete the LSA from the LSDB so that the callback has accessibily
     to the interface prior to deletion.
  2. Fix a double free for the opaque function table data structure.
  3. Assure that the opaque per-type information and opaque function table
     structures are removed at the same time since they have back pointers
     to one another.
  4. Add a topotest variation for the link-local opaque LSA crash.

Signed-off-by: Acee <aceelindem@gmail.com>
2023-11-28 16:18:55 -05:00
Russ White
e854c43b30
Merge pull request #14512 from pguibert6WIND/vpnv4_with_no_rt_export
L3VPN exportation by using 'route-map vpn export' command instead of 'rt vpn export' command
2023-11-28 08:34:58 -05:00
Francois Dumontet
a5bee822f4 tests: bgp_snmp_bgp4v2mib fix some random failure
avoid to consider additionnal traps randomly received later

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-11-22 07:24:00 +00:00
Philippe Guibert
fc1177fe20 bgpd, topotests: apply route-map after rt vpn export
A route-map can be programmed to remove the route-target which
has been set with 'rt vpn export' command, but fails to remove
it.

Fix this by applying the route-map, then considering the resulting
extended community-list.
Add some tests to catch this issue.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-11-21 18:10:38 +01:00
Philippe Guibert
309e692d10 topotests: bgp_vpnv4_ebgp, check 'extcommunity rt' presence
Add a test to check that the presence of a route-map at
exportation with a 'set extcommunity rt' is enough to allow
the prefix to be exported.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-11-21 18:10:38 +01:00
Donatas Abraitis
8eba97d395 tests: Set community for conditionally advertised routes
Just to make sure we don't crash bgpd with double-free if an existing route
already exists.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-21 10:49:36 +02:00
Donald Lee
fca8ee275c lib: Update int and ll decoders with new MTYPE
In the master branch a new MTYPE_SCRIPT_RES was created for
frrscript_get_results, lua_to decoders should use that

Signed-off-by: Donald Lee <dlqs@gmx.com>
2023-11-20 20:45:02 -05:00
Donald Lee
d2acf63f16 lib: Create encoders for int and rename stuff
Create encoders/decoders for int and rename current int encoders
/decoders to long long.

Signed-off-by: Donald Lee <dlqs@gmx.com>
2023-11-20 20:45:02 -05:00
Russ White
072a0b5839
Merge pull request #14135 from squirrelking57/fix_isis_adj_level
isisd:change ngh lvl when int circuit type setted
2023-11-14 08:49:35 -05:00
Russ White
8aae3ea5d2
Merge pull request #11800 from mxyns/bmp-locribmon
bgpd: BMP Loc-Rib Monitoring (RFC9069) Implementation
2023-11-14 08:27:45 -05:00
Donald Sharp
3edeaa9066 tests: Remove log monitor XX it's not a cli command
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-13 09:16:45 -05:00
Donald Sharp
314a98d2b4
Merge pull request #14756 from opensourcerouting/fix/bgpd_dynamic_cap_addpath_topotest
tests: Check received prefixes before immediately sending dynamic capabilities
2023-11-09 07:37:26 -05:00
Donatas Abraitis
06c1e53036
Merge pull request #14727 from fdumontet6WIND/bgp4v2_snmp
bgpd: fix bgp4v2 MIB NLRI INDEX format and order
2023-11-09 10:20:33 +01:00
Francois Dumontet
7df8e65e81 tests: take into account fix for NLRI Index
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-11-08 21:20:17 +01:00
Donatas Abraitis
c12b976c0a tests: Check received prefixes before immediately sending dynamic capabilities
If we send capabilities immediately, before receiving an UPDATE message, we end up
with a notification received from the neighbor. Let's wait until we have the fully
converged topology and do the stuff.

Tested locally and can't replicate the failure, let's see how happy is the CI this time.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-08 16:39:08 +02:00
Christian Hopps
c27b054efe tests: add ability to show all types of valgrind memleaks
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-07 15:29:37 -05:00
Farid MIHOUB
e7adf2762f tests: extend the bmp test to support bmp loc-rib
Configure the bmp monitor unicast loc-rib.
Check the logging messages for the updated/withdrawn prefixes with
the presence of the loc-rib peer-type.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
2023-11-04 12:19:30 +01:00
Farid MIHOUB
e65db90567 tests: rework bmp policy message logging
Add "policy" field to the logged bmp messages so policy checks within
topotests would be easier and clearer.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
2023-11-04 12:19:30 +01:00
Donald Sharp
2a65f05d77 lib: Remove unused WQ_RETRY_XXX enums
These enum's have been around since 2005 and FRR
still does not have any users of these particular
values.  After almost 20 years, let's simplify the
code slightly and remove them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-03 18:06:01 +00:00
Donald Sharp
d4aa24ba7d *: Introduce Local Host Routes to FRR
Create Local routes in FRR:

S   0.0.0.0/0 [1/0] via 192.168.119.1, enp39s0, weight 1, 00:03:46
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:03:51
O   192.168.119.0/24 [110/100] is directly connected, enp39s0, weight 1, 00:03:46
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:03:51
L>* 192.168.119.224/32 is directly connected, enp39s0, 00:03:51
O   192.168.119.229/32 [110/100] via 0.0.0.0, enp39s0 inactive, weight 1, 00:03:46
C>* 192.168.119.229/32 is directly connected, enp39s0, 00:03:46

Create ability to redistribute local routes.

Modify tests to support this change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-01 17:13:06 -04:00
Donald Sharp
8e3a96e846
Merge pull request #14546 from adrianomarto/ospf6-point-to-multipoint
OSPF6 point to multipoint
2023-10-31 18:20:04 -04:00
Russ White
644386fe48
Merge pull request #14388 from pguibert6WIND/redistribute_table_bgp_2
Redistribute table bgp without copying data to the default routing table
2023-10-31 13:23:57 -04:00
Russ White
95f841c9be
Merge pull request #14661 from opensourcerouting/feature/enable_enforce_first_as_by_default
bgpd: Enable `enforce-first-as` by default
2023-10-31 10:40:23 -04:00
Russ White
49dc248e5c
Merge pull request #14343 from pguibert6WIND/bgp_label_manual_allocate_label_mgr
Bgp label manual allocate label mgr
2023-10-31 10:31:11 -04:00
Christian Hopps
62af972148 tests: add gdb integration with valgrind
Allows you to run daemons under valgrind integrated with gdb. When daemons are
run with the ``--gdb-daemons/--gdb-routers`` options they will be wired up to
valgrind using vgdb (valgrind tool) so gdb will stop when valgrind errors are
encountered.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-30 07:12:27 -04:00
mobash-rasool
ed0cfbecc7
Merge pull request #14635 from opensourcerouting/fix/ospf6d_loopback_cost
ospf6d: Set loopback interface cost to 0
2023-10-30 09:49:58 +05:30
Donald Sharp
2fef2017ed
Merge pull request #14662 from opensourcerouting/fix/drop_broken_tests
tests: Drop a couple unnecessary unit tests
2023-10-27 10:14:40 -04:00
Donatas Abraitis
322462920e bgpd: Enable enforce-first-as by default
It's been for a while disabled by default, but this seems reasonable to flip it.

We had `bgp enforce-first-as` as a global BGP knob to enable/disable this
behavior globally, later we introduced `enforce-first-as` per neighbor, with disabled
by default. Now let's enable this by default by bringing a global `bgp enforce-first-as`
command back.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-27 14:27:02 +03:00
Donatas Abraitis
26d0f530a3 tests: Disable debug log for bgp_vpnv4_asbr.r2
For the same reason as we disable debug logs for CI everywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-27 14:09:02 +03:00
Christian Hopps
8e630c2946 tests: have unit-test check more paths for the grpc.so module
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-26 21:39:13 -04:00
Donatas Abraitis
dede6261d8 bgpd: Drop unnecessary unit test for software-version capability
It's tested above, and was just copied from extended-nexthop as an example
which is broken too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-26 17:24:42 +03:00
Donatas Abraitis
39d6b2888c tests: Drop broken unit test for extended-nexthop capability
extended-nexthop capability can't be unset to interface-based peers.

Anyway, this is always silently ignored:

```
✖ [test] peer\capability extended-nexthop
► prepare: initialize bgp test environment
► case 01: set peer-flag [capability extended-nexthop] on [IP-TEST]
► error: execution of command [no neighbor IP-TEST capability extended-nexthop] has failed with code [13]
failed
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-26 17:22:02 +03:00
Donatas Abraitis
8aeb17d692 tests: Adopt ospf6_gr_topo1 tests for OSPFv3 loopback cost as 0
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-26 07:39:29 +03:00
Donatas Abraitis
d7e9714643 tests: Use igpMetric as 10 not 20, after OSPFv3 loopback cost changes
Fixes: fa3140f7927838c432a02ee4f1c1847387b7be6d ("ospf6d: Set loopback interface cost to 0")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-26 07:39:29 +03:00
Donatas Abraitis
e8615867d0 tests: Check if OSPFv3 loopback interface gets cost as 0
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-25 10:33:50 +03:00
Russ White
f239b0f05a
Merge pull request #14639 from donaldsharp/zebra_nexthop_search_up
zebra: Allow longer prefix matches for nexthops
2023-10-24 16:13:20 -04:00
Donatas Abraitis
26373fbedd
Merge pull request #14333 from fdumontet6WIND/bgp4v2_snmp
bgpd: add support of traps for bgp4-mibv2
2023-10-24 21:34:47 +03:00
Francois Dumontet
9d14c70b88 tests: add bgp4v2 MIB traps test
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-10-24 17:16:47 +02:00
Francois Dumontet
50c95b6be9 tests: add bgp4 MIB traps test
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-10-24 17:16:47 +02:00
Francois Dumontet
6261c2b994 tests: lib add support of snmptrapd daemon
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-10-24 17:16:47 +02:00
Russ White
27a78f80d8
Merge pull request #13979 from gpnaveen/bgp_unique_rid
tests: Adding a bgp router id chaos test case.
2023-10-24 06:09:58 -04:00
Donatas Abraitis
614d7873d5
Merge pull request #14634 from LabNConsulting/chopps/gdb-use-emacs
tests: add --gdb-use-emacs option
2023-10-24 08:58:40 +03:00
Sososhas
b52f969f3d isisd:change ngh lvl when int circuit type setted
I added a new variable to calculate the required level of neighborhood,
as well as checking if the interfaces are in the same area,
in accordance with cisco

Signed-off-by: Sososhas <1248756005hfh@gmail.com>

isis:fixed adj level in topotests

fixed adj level on rt6

Signed-off-by: Sososhas <1248756005hfh@gmail.com>
2023-10-23 17:11:16 +03:00
Donald Sharp
a272a2b364 zebra: Allow longer prefix matches for nexthops
Zebra currently does a shortest prefix match for
resolving nexthops for a prefix.  This is typically
an ok thing to do but fails in several specific scenarios.
If a nexthop matches to a route that is not usable, nexthop
resolution just gives up and refuses to use that particular
route.  For example if zebra currently has a covering prefix
say a 10.0.0.0/8.  And about the same time it receives a
10.1.0.0/16 ( a more specific than the /8 ) and another
route A, who's nexthop is 10.1.1.1.  Imagine the 10.1.0.0/16
is processed enough to know we want to install it and the
prefix is sent to the dataplane for installation( it is queued )
and then route A is processed, nexthop resolution will fail
and the route A will be left in limbo as uninstallable.

Let's modify the nexthop resolution code in zebra such that
if a nexthop's most specific match is unusable, continue looking
up the table till we get to the 0.0.0.0/0 route( if it's even
installed ).  If we find a usable route for the nexthop accept
it and use it.

The bgp_default_originate topology test is frequently failing
with this exact problem:

B>* 0.0.0.0/0 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
B   1.0.1.17/32 [200/0] via 192.168.0.1 inactive, weight 1, 00:00:21
B>* 1.0.2.17/32 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
C>* 1.0.3.17/32 is directly connected, lo, 00:02:00
B>* 1.0.5.17/32 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32
B>* 192.168.0.0/24 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
B   192.168.1.0/24 [200/0] via 192.168.1.1 inactive, weight 1, 00:00:21
C>* 192.168.1.0/24 is directly connected, r2-r1-eth0, 00:02:00
C>* 192.168.2.0/24 is directly connected, r2-r3-eth1, 00:02:00
B>* 192.168.3.0/24 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32
B   198.51.1.1/32 [200/0] via 192.168.0.1 inactive, weight 1, 00:00:21
B>* 198.51.1.2/32 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32

Notice that the 1.0.1.17/32 route is inactive but the nexthop
192.168.0.1 is covered by both the 192.168.0.0/24 prefix( shortest match )
*and* the 0.0.0.0/0 route ( longest match ).  When looking at the logs
the 1.0.1.17/32 route was not being installed because the matching
route was not in a usable state, which is because the 192.168.0.0/24
route was in the process of being installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-10-23 08:15:11 -04:00
Christian Hopps
a921202a85 tests: add --gdb-use-emacs option
When specified `--gdb-use-emacs` will launch the daemon with gdb inside a
running emacs server using `emacsclient --eval` commands.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-23 05:11:32 -04:00
Philippe Guibert
deac143c6e topotests: add bgp_redistribute_table test
There is no test that ensures the test of the 'redistribute
table-direct' facility. Add a test that checks that routes
created before and after BGP is started, is correctly imported.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-20 13:28:52 +02:00
Donatas Abraitis
3c94151258 tests: Check if BGP conditional advertisement works fine with static routes
If we modify the prefix-list that is used to define the routes to be
advertised, all of them MUST be advertised.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-20 12:58:33 +03:00
Donald Sharp
627888864d
Merge pull request #14614 from opensourcerouting/feature/bgpd_handle_orf_capability_via_dynamic_capability
bgpd: Handle ORF capability using dynamic capabilities
2023-10-19 16:01:24 -04:00
Louis Scalbert
3cae026428 topotests: add bgp_l3vpn_label_export test
There is no test that checks for the label allocation mechanisms
involved when using BGP and/or LDP.
- Some configuration changes are applied in the BGP configuration,
and the impact is checked on the BGP contexts, and on the label
manager.
- The label manager dynamic range is reconfigured, BGP auto mode
is checked against the new range, along with LDP when restarting.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 17:46:28 +02:00
Philippe Guibert
8a400bb70a topotests: bgp_srv6l3vpn_to_bgp_vrf[2,3], ignore tableVersion
The expected tableVersion is wrong, when checking r1 table.

The tableVersion value increments at each route updates. The
previous commit brought an additional route update with the
'vpn_leak_postchange_all()' call.

Keep the function call, and do not check the table version
in bgp_srv6l3vpn_to_bgp_vrf[2,3] tests.

Fixes: 205b62ffae2c ("bgpd: fix hardset l3vpn label available in mpls pool")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 17:45:29 +02:00
Donatas Abraitis
4b843e759b tests: Rename test_bgp_dynamic_capability_role
Was copied, but forgot to rename accordingly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-18 12:31:22 +03:00
Philippe Guibert
dfb56806af topotests: fix bgp_vpnv[4,6]_per_nexthop prefix not updated
The bgp_vpnv[4,6]_table_check() functions analyze the
expected label value of VPN prefixes present in the BGP table.
However, it doesn't verify if the prefixes exist before doing
this. Consequently, the tests will fail if the prefixes do not
show up immediately.
Ensure that all expected VPN prefixes are present before
executing the function.

Fixes: ae5a6bc1f6 ("topotests: add bgp mpls allocation per next-hop test")
Fixes: 37a02a8dcb ("topotests: add bgp_vpnv6 test allocation")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 09:41:02 +02:00
Philippe Guibert
9d32589b58 zebra, test: mark mpls label chunks as dynamic or static
The zebra label manager stores the mpls label chunks,
but does not record if the label request was for a
dynamic or a static chunk.

For all label requests accepted, mark the label chunk
if the 'base' parameter is set to MPLS_LABEL_BASE_ANY,
unmark it otherwise.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 09:41:02 +02:00
Philippe Guibert
4a81210169 topotests: fix accept_own test, bgp label value conflict with ldp
When configuring manual label value in BGP L3VPN, the label
allocation conflicts with the LDP label pool which is in use.
Choose BGP label values different that the ones from LDP.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 09:41:02 +02:00
Philippe Guibert
cb86d8e3a4 bgpd: fix label allocation should not be allocated at startup
BGP always asks zebra for a chunk of MPLS label even if it doesn't need it.
Fix this by correcting the rounding up "labels_needed" formula.

Fixes: 80853c2ec7 ("bgpd: improve labelpool performance at scale")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 09:41:02 +02:00
Donatas Abraitis
1fb08e91d7 tests: Check if ORF capability works with BGP dynamic capabilities
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-17 16:00:00 +03:00
Donald Sharp
c8d568487c
Merge pull request #14599 from opensourcerouting/fix/issue_14419
tests: Check if evpn route-map match by route type works
2023-10-16 10:20:23 -04:00
Donatas Abraitis
c7a9af861a tests: Check if evpn route-map match by route type works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-15 19:46:34 +03:00
Donald Sharp
50e6ba26a4
Merge pull request #14582 from cloudscale-ch/denis/topotest-for-14488
tests: Add OSPF test for issue 14488
2023-10-14 09:42:49 -04:00
Donatas Abraitis
0a8ce5f3f3
Merge pull request #14553 from donaldsharp/zebra_weighted_ecmp
Zebra weighted ecmp
2023-10-13 23:09:18 +03:00
Denis Krienbühl
616e1fa9df
tests: Add OSPF test for issue 14488
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with https://github.com/FRRouting/frr/pull/13340
and the latest master (d2324b7b4a).

See https://github.com/FRRouting/frr/issues/14488

Signed-off-by: Denis Krienbühl <denis.krienbuehl@cloudscale.ch>
2023-10-13 17:16:19 +02:00
Igor Ryzhov
7d67b9ff28 build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-10-12 21:23:18 +03:00
Donald Sharp
3d8ba5c5ac tests: Fixup bgp_link_bw_ip test to new behavior
Old behavior was metric values between 1-100,
now we have metric values between 1-255.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-10-12 13:35:48 -04:00
Russ White
97d8e5cecd
Merge pull request #14537 from opensourcerouting/feature/bgpd_aod
bgpd: Implement EBGP-OAD peering type
2023-10-11 10:22:26 -04:00
Russ White
9ff1a8c550
Merge pull request #14528 from opensourcerouting/feature/bgpd_handle_addpath_capability_via_dynamic_capability
bgpd: Handle Addpath capability using dynamic capabilities
2023-10-11 10:16:18 -04:00
Donald Sharp
0dc12c9003 Revert "lib: register bgp link-state afi/safi"
This reverts commit 1642a68d60.
2023-10-10 16:45:57 -04:00
Donald Sharp
c4edb3a453 Revert "tests: add bgp_linkstate_topo1"
This reverts commit a0e6cd4c8f.
2023-10-10 16:43:17 -04:00
Donald Sharp
547a0d02aa Revert "tests: add link-state attribute display in bgp_linkstate_topo1"
This reverts commit 5727195cbf.
2023-10-10 16:33:07 -04:00
Adriano Marto Reis
108adcddbb tests: Ajusting the test to the new OSPF6 behaviour
Now OSPF6 shares the /128 prefix by default. Adjusting the expected
number of next hops according to that.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2023-10-10 12:09:07 +10:00
Adriano Marto Reis
a5677ca1e0 tests: OSPF6 point-to-multipoint topotest
* Check if FRR is running
* Check if OSPFv3 converges
* Check OSPFv3 Routing Tables
* Check Linux Kernel Routing Table

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2023-10-10 08:10:49 +10:00
Donatas Abraitis
ba67eb6bd0 tests: Check if EBGP-OAD works
https://datatracker.ietf.org/doc/html/draft-uttaro-idr-bgp-oad

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-06 21:53:43 +03:00
Donald Sharp
c516447847
Merge pull request #14534 from mjstapp/fix_topo_nhgid
tests: locate nhg id from json output in all_proto_startup
2023-10-05 15:36:27 -04:00
Mark Stapp
22fb94a248 tests: locate nhg id from json output in all_proto_startup
Don't hard-code a sharpd nhg id: those values aren't stable
if the daemons/protos/route-types change. Use json show output
to find the id in the 'resilient' nhg test case in
the all_protocol_startup suite.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-10-05 13:47:17 -04:00
Donatas Abraitis
51255e1118 tests: Check if addpath capability is exchanged dynamically
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-03 17:44:19 +03:00
Russ White
373d46d0f7
Merge pull request #14511 from opensourcerouting/fix/bgpd_software_version_capability
bgpd: Validate maximum length of software version when handling via dynamic caps
2023-10-03 10:36:21 -04:00
Philippe Guibert
85caa21dff topotests: add bgp_large_comm_list_match test
Add a topotest to check for proper functioning of the
bgp large community list match operation under a route-map.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-02 15:24:18 +02:00
Philippe Guibert
aa511000e0 bgpd: add 'match community-list any' function
There is no match mechanism to match one community from the
incoming community-list. Add the 'any' keyword to the 'match
route-map' command of communit-list and large-community-list.

> match community-list AAA any
> match large-community-list AAA any

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-02 15:24:18 +02:00
Donatas Abraitis
0e43f80ab9 tests: Make sure we have a valid FRRouting software version string
It can't begin with anything else, otherwise something is broken on the wire.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-29 12:15:24 +03:00
Russ White
8e755a03a3
Merge pull request #12649 from louis-6wind/bgp-link-state
bgpd: add basic support of BGP Link-State RFC7752
2023-09-26 10:07:02 -04:00
Donatas Abraitis
56d8305481
Merge pull request #14473 from cscarpitta/bugfix/fix-srv6-topotest-warning
tests: Fix DeprecationWarning in SRv6 L3VPN topotest
2023-09-24 20:47:07 +03:00
Donald Sharp
4f0db0daaf
Merge pull request #14470 from opensourcerouting/fix/rewrite_dynamic_capabilities_tests
tests: Improve BGP dynamic capability tests
2023-09-23 09:50:43 -04:00
Carmine Scarpitta
71ed1868d6 tests: Fix DeprecationWarning in SRv6 L3VPN topotest
Fix the following warning:

tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py:42
  /media/SharedUTM/workspace/frr/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py:42: DeprecationWarning: invalid escape sequence '\ '

In test_bgp_srv6l3vpn_sid.py we have a comment containing some '\'
characters. Python mistakenly tries to interpret such "\" characters
as escape sequences, which leads to the above warning.

Let's tell Python to treat the comment as a raw string,
so that it simply treats backslashes as literal characters rather than
escape sequences.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-09-22 18:43:42 +02:00
Donald Sharp
eceb1cab6d
Merge pull request #14450 from kuldeepkash/general_fixes
tests: Adding BGP convergence verification before starting PIM tests
2023-09-22 09:53:03 -04:00
Donatas Abraitis
fa5783bbab tests: Check notification/capability received message stats instead of reset/established
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-22 15:50:27 +03:00
Donatas Abraitis
64b4a93d81 tests: Use frr.conf for bgp_dynamic_capabily tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-22 15:20:22 +03:00
Kuldeep Kashyap
8824e302bf tests: Fix for issue when RP is changed
Issue: https://github.com/FRRouting/frr/issues/14057
Fix: Added some sleep to make sure prune is received before
RP is changed.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-09-20 13:11:31 +00:00
Kuldeep Kashyap
0cf046c647 tests: Adding BGP convergence verification before starting PIM tests
Issue: Sometimes BGP neighbors are not up before doing any PIM
operation, that is causing some tests failures.
https://github.com/FRRouting/frr/issues/14441

Fix: Added BGP convergence for all tests where BGP is used to make
sure all BGP neigbhors

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-09-20 13:11:19 +00:00
Dmytro Shytyi
9f3ceabd49 tests: add srv6 multiple segs SIDs topotest
Configure and verify the installed srv6 route with multiple segs SIDs

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-09-20 15:07:15 +02:00
Donald Sharp
4e5627fb20
Merge pull request #14442 from mjstapp/fix_no_ctime
bgpd, pathd: replace ctime() with ctime_r()
2023-09-20 07:32:51 -04:00
Donatas Abraitis
da1cf4f151
Merge pull request #14440 from fdumontet6WIND/fix_oid_bgp4v2
bgpd: fix  SNMP oid in bgp4v2
2023-09-20 09:58:58 +03:00
Mark Stapp
5b4610fa59 tests: replace ctime with ctime_r
Replace ctime with ctime_r in bgp test.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-09-19 16:25:01 -04:00
Russ White
ffbff9b515
Merge pull request #14436 from opensourcerouting/fix/set_mss_for_passive_nodes
bgpd: Set TCP MSS for the socket even if the session is set to passive
2023-09-19 10:18:14 -04:00
Russ White
fd8b00ed53
Merge pull request #14420 from opensourcerouting/fix/remove_private_asn_after_route_map
bgpd: Remove private ASNs after we modify the as-path with the route-map
2023-09-19 10:16:33 -04:00
Russ White
a9a89805ec
Merge pull request #14398 from m-varasteh/ospfd-rfc5709
ospfd: add support for RFC 5709 OSPFv2 HMAC-SHA Cryptographic Authentication
2023-09-19 10:14:14 -04:00
Russ White
1e00784731
Merge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_dynamic_capability_split
bgpd: Handle LLGR capability using dynamic capabilities
2023-09-19 10:12:35 -04:00
Francois Dumontet
b8fe1c16de bgpd: snmp MIB bgp4v2 fix indexes in OID
currently snmpwalk give results such :
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv6z.10.125.0.2 = INTEGER: ipv4(1)
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = INTEGER: ipv6(2)
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv6z.10.125.0.2 = Hex-STRING: 0A 7D 00 02
BGP4V2-MIB::bgp4V2PeerRemoteAddr.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Hex-STRING: FD 00 01 25 00 00 00 00 00 00 00 00 00 00 00 03

the expected result is the following

BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv4.10.125.0.2 = INTEGER: ipv4(1)
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 =
 INTEGER: ipv6(2)
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv4.10.125.0.2 = Hex-STRING: 0A 7D 00 02
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Hex
-STRING: FD 00 01 25 00 00 00 00 00 00 00 00 00 00 00 03

in draft-ietf-idr-bgp4-mibv2-11

INDEX for Bgp4V2PeerEntry is define as follows
INDEX {
          bgp4V2PeerInstance,
          bgp4V2PeerRemoteAddrType,
          bgp4V2PeerRemoteAddr
      }

the peer instance is defined as follows
OBJECT bgp4V2PeerInstance
        SYNTAX Unsigned32 (1..4294967295)

more this interpretation is conformant with the snmpwalk implementation
for instance we obtain the following result

swBgp.bgp4V2.bgp4V2Objects.bgp4V2PeerTable.bgp4V2PeerEntry.bgp4V2PeerRemotePort.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Gauge32: 179

swBgp.bgp4V2.bgp4V2Objects.bgp4V2PeerTable.bgp4V2PeerEntry.bgp4V2PeerRemoteAs.1.ipv4.10.125.0.2 = Gauge32: 65200

since currently we are not supporting  multi instance for bgp peer in
SNMP the bgp4V2PeerInstance value is set to 1 coforming to:

"Implementations that do not support multiple routing instances should return 1 for this object."

test is updated accordingly to fix.
currently index for bgp4V2NlriEntry is not coformant to MIB definition

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-09-19 14:26:41 +02:00