Commit graph

35617 commits

Author SHA1 Message Date
Christian Hopps 7b76c8f67b ci: only run conflict check on pull-requests
This change will stop this action from running on forked repos.
Previously whenever one pushed a change to one's development branch the
action would "run but skip" which still generated an email notifications
and thus was very annoying. :)

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-02 10:14:34 -04:00
Christian Hopps 8954dd3a6b
Merge pull request #16139 from donaldsharp/mroute_error
pimd: Give a clearer warning when the kernel is not compiled right
2024-06-01 10:41:49 -04:00
Donald Sharp 894e72895e
Merge pull request #16127 from opensourcerouting/fix/eor_not_only_for_gr
bgpd: Send End-of-RIB not only if Graceful Restart capability is received
2024-06-01 10:08:25 -04:00
Donald Sharp 517bdaa313
Merge pull request #16121 from LabNConsulting/chopps/docker-update
Update ubuntu docker images adding github build and test action
2024-06-01 10:02:05 -04:00
Christian Hopps 15a33df79c github: add docker build and test github action
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 18:54:01 -04:00
Donald Sharp 5ef144ce6d pimd: Give a clearer warning when the kernel is not compiled right
When the kernel is not compiled with mroute vrf's enabled it will
fail the call to initialize the vrf.  As such let's recognize this
specific error code and output a specific warning to the operator
to help them figure this problem out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-31 11:29:40 -04:00
Christian Hopps 854caad3ea docker: update docker reference to follow latest docs
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 11:13:16 -04:00
Jafar Al-Gharaibeh cdc964c233
Merge pull request #16111 from donaldsharp/ospfv3_read_after
ospf6d: Prevent heap-buffer-overflow with unknown type
2024-05-31 10:09:24 -05:00
Donald Sharp 85120c06f1
Merge pull request #16115 from Jafaral/pim-ssm-any
pimd: fix crash when mixing ssm/any-source joins
2024-05-31 10:57:29 -04:00
Donald Sharp b1f404322e
Merge pull request #16125 from opensourcerouting/ts-expand-fix-guard
lib: make `python/ts_expand.py` actually work
2024-05-31 10:48:15 -04:00
Donald Sharp 9069c93e75
Merge pull request #16124 from LabNConsulting/chopps/test-cleanup
Fix grpc-client parallel run and other small test fixes
2024-05-31 10:47:52 -04:00
Donatas Abraitis 637ab53f75 bgpd: Send End-of-RIB not only if Graceful Restart capability is received
Before we checked for received Graceful Restart capability, but that was also
incorrect, because we SHOULD HAVE checked it per AFI/SAFI instead.

https://datatracker.ietf.org/doc/html/rfc4724 says:

Although the End-of-RIB marker is specified for the purpose of BGP
   graceful restart, it is noted that the generation of such a marker
   upon completion of the initial update would be useful for routing
   convergence in general, and thus the practice is recommended.

Thus, it might be reasonable to send EoR regardless of whether the Graceful Restart
capability is received or not from the peer.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-31 15:03:55 +03:00
David Lamparter 5daf64f63b lib: make python/ts_expand.py actually work
lib/typesafe.h was supposed to be outside the _TYPESAFE_EXPAND_MACROS
guard, so that including lib/atomlist.h grabs all the typesafe container
macros.

(No effect on normal build, as _TYPESAFE_EXPAND_MACROS is never defined
there.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-31 11:32:05 +02:00
Christian Hopps 30d3b4d47e tests: use raw string for doc to avoid deprecated python warning
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps e855436cc6 tests: all errors go to log (and thus stderr)
Only output requested information to stdout so it can be
filtered and captured in shell variables etc...

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps 5032be4f1c tests: fix pim test to wait for actual OSPF route convergence
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps cd5791c12e tests: fix multiple grpc-client.py running in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Jafar Al-Gharaibeh a951960a15 pimd: fix crash when mixing ssm/any-source joins
There is no reason to call `igmp_anysource_forward_stop()` inside a call to
`igmp_get_source_by_addr()`; not only it is not expected for a "get" function
to perform such an action, but also the decision to start/stop forwarding is
already handled correctly by pim outside `igmp_get_source_by_addr()`.
That call was left there from the days pim was initially imported into the sources.

The problem/crash was happening because `igmp_find_source_by_addr()` would fail to
find the group/source combo when mixing `(*, G)` and `(S, G)`. When having an existing
flow `(*, G)`, and a new `(S, G)` igmp is received, a new entry is correctly created.
`igmp_anysource_forward_stop(group)` always stops and eventually frees `(*, G)`, even
when the new igmp is `(S, G)`, leaving a bad state. I.e, the new entry for `(S, G)`
causes `(*, G)` to be deleted.

Tested the fix with multiple receivers on the same interface with several ssm and
any source senders and receivers with various combination of start/stop orders and
they all worked correctly.

Fixes: #15630

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-05-30 23:20:03 -05:00
Jafar Al-Gharaibeh 8e7bc85b71
Merge pull request #15879 from LabNConsulting/dleroy/nhrpd-shutdown-fix
nhrpd: fixes core dump on shutdown
2024-05-30 18:27:37 -05:00
dleroy a7037ab234 tests: add a topotest to verify nhrp shortcuts in a redundant nhs topology
Contains 2 testcases. The first does a basic configuration/connectivity.
The second testcase initiates a shortcut through the primary NHS,
verifies shortcut routes are installed. Primary NHS interface brought
down and verify that the shortcut is not impacted. Finally verify that
after the shortcut expires, it is able to be re-established via a backup
NHS.

Signed-off-by: dleroy <dleroy@labn.net>
2024-05-30 12:25:07 -07:00
dleroy a4ee976273 nhrpd: fixes core dump on shutdown
When nhrpd is shutdown via nhrp_request_stop() the shutdown
sequence was not handling the case where there are active
shortcut routes installed. The zebra client and shortcut rib
were being cleaned up before vrf_terminate() had an opportunity
to delete the active routes.

Signed-off-by: dleroy <dleroy@labn.net>
2024-05-30 12:25:07 -07:00
Iggy Frankovic 826f2510e6 ospf6d: Prevent heap-buffer-overflow with unknown type
When parsing a osf6 grace lsa field and we receive an
unknown tlv type, ospf6d was not incrementing the pointer
to get beyond the tlv.  Leaving a situation where ospf6d
would parse the packet incorrectly.

Signed-off-by: Iggy Frankovic <iggy07@gmail.com>
2024-05-30 08:02:25 -04:00
Donatas Abraitis fd8a2c400a
Merge pull request #16109 from donaldsharp/seg6_topotest_fix
tests: Fix zebra_seg6_route
2024-05-30 13:59:06 +03:00
Donald Sharp 8f23eb7746
Merge pull request #16102 from lsang6WIND/relative_path
yang: use relative path instead of absolute one for route-map
2024-05-29 15:19:17 -04:00
Donald Sharp f766686bce tests: Fix zebra_seg6_route
Locally this test would occassionally fail for me
because the connected route the sharp route being
installed has not fully come up yet due to heavy
load and start up slowness.  Add a bit of code
to look for the problem and make sure it doesn't
happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-29 14:52:44 -04:00
Donald Sharp 0008dec480
Merge pull request #16098 from LabNConsulting/aceelindem/ospfv3-route-asbr-change
ospf6d: OSPFv3 route change comparision fixed for ASBR-only change
2024-05-29 08:58:42 -04:00
Donald Sharp 33e01b663e
Merge pull request #16097 from opensourcerouting/fix/safety_check_for_extcommunities
bgpd: Make sure we have enough data to handle extended link bandwidth
2024-05-29 08:55:08 -04:00
Loïc Sang f1ea52bee9 yang: use relative path instead of absolute one for route-map
Using absolute xpath is not optimal for finding the target node. As the
route map configuration grows, the yang validation will take more time
to complete. Relative paths are much faster.

Tested with a config file that contains ~3k route map config lines.
- before:
time cat conf | vtysh
configure
log syslog errors
router bgp 65000
!
route-map RM:BGP:VPNV4:PEER:VRR9:IN10001 permit 101
 match community CL:HCC:PATH_PRIO1_EAST1
  set local-preference 15200
!
...
route-map RM:BGP:VPNV4:PEER:VRR9:IN10001 permit 1182
 match community CL:HCC:PATH_PRIO1_EAST1082
 set local-preference 16281
!

real    13m51.500s
user    0m0.522s
sys     0m4.854s

- after:
time cat conf | vtysh
...
real    0m48.390s
user    0m0.384s
sys     0m1.245s

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2024-05-29 13:11:03 +02:00
Igor Ryzhov f8abf96440
Merge pull request #15082 from louis-6wind/fix-iff-lower-up
lib: take into account the Linux IFF_LOWER_UP flag
2024-05-29 00:01:20 +03:00
Acee 772688d2d3 ospf6d: OSPFv3 route change comparision fixed for ASBR-only change
When a router route already exists in the area border routers table
as an ABR and it solely changes its ABR or ASBR status, the change
was missed and border route is not updated. This fixes the comparison
for the router_bits in the ospf6_path structure.

This fixes issue https://github.com/FRRouting/frr/issues/16053 although
the actual problem is not the computing router (r2) and not the OSPFv3
redistribution (r3).

Signed-off-by: Acee <aceelindem@gmail.com>
2024-05-28 16:46:18 -04:00
Donald Sharp 7ac981384c
Merge pull request #16055 from acooks-at-bda/cleanup-some-ospf6-lsa-macros
Cleanup some OSPF6_LSA_ macros
2024-05-28 13:15:54 -04:00
Donald Sharp cccb0cd805
Merge pull request #16075 from anlancs/ospfd/fix-cmd-instance
ospfd: add instance id for one command
2024-05-28 13:06:43 -04:00
Russ White 447e7be0e4
Merge pull request #15993 from zhou-run/202405091114
isisd: fix crash when deactivating ISIS adjacency on the interface.
2024-05-28 11:23:32 -04:00
Russ White 57b472153c
Merge pull request #16083 from opensourcerouting/fix/overflow_bgp_dynamic_capability
BGP dynamic capability some fixes
2024-05-28 10:31:42 -04:00
Russ White ffaddf36a6
Merge pull request #16023 from opensourcerouting/fix/rpki_show_stuff
bgpd: Split `rpki cache` command into separate per SSH/TCP
2024-05-28 10:23:10 -04:00
Donald Sharp c2b44a8bbe
Merge pull request #16091 from y-bharath14/srib-topotests-commits
tests: Organizing variables using format method
2024-05-28 10:07:12 -04:00
zhou-run 6924749bfe isisd: fix crash when deactivating ISIS adjacency on the interface.
1. When the command "no <ip|ipv6> router isis WORD" is executed on the interface, it invokes list_delete_all_node to iterate and release the memory of all nodes in the cirtcuit->u.bc.adjdb[1] linked list. However, the nodes are not unlinked during this traversal process, leading to the call of *list->del to delete the data of the linked list nodes.

2. For ISIS, deleting the data of the linked list nodes is done by calling isis_delete_adj. Subsequently, isis_level2_adj_up will be called to iterate and query the cirtcuit->u.bc.adjdb[1] linked list. If there are many neighbors on this interface, accessing the memory of the released linked list nodes may occur.

3. Not limited to ISIS, if the linked list is not unlinked during the deletion of all nodes in process 1, *list->del should not be allowed to iterate through the list again.

The backtrace is as follows:

(gdb) bt
    at isisd/isis_csm.c:196
    context=<optimized out>) at lib/northbound.c:1131
    errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1356
    at lib/northbound.c:1473
    errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:906
    comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=8192) at lib/northbound.c:938
    filter=FILTER_RELAXED) at lib/command.c:971
    at lib/command.c:1030
    vtysh=vtysh@entry=0) at lib/command.c:1198
    at isisd/isis_csm.c:196
    context=<optimized out>) at lib/northbound.c:1131
    errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1356
    at lib/northbound.c:1473
    errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:906
    comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=8192) at lib/northbound.c:938
    filter=FILTER_RELAXED) at lib/command.c:971
    at lib/command.c:1030
    vtysh=vtysh@entry=0) at lib/command.c:1198
0  0x00007f7d6e541fe1 in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007f7d6e63188c in core_handler (signo=11, siginfo=0x7ffc0ced2630, context=<optimized out>) at lib/sigevent.c:262
2  <signal handler called>
3  0x00005647f5b11568 in isis_level2_adj_up (area=area@entry=0x5647f7c89830) at isisd/isis_lsp.c:423
4  0x00005647f5b14073 in isis_reset_attach_bit (adj=0x5647f7cad690) at isisd/isis_lsp.c:474
5  lsp_handle_adj_state_change (adj=0x5647f7cad690) at isisd/isis_lsp.c:2162
6  0x00005647f5b53675 in hook_call_isis_adj_state_change_hook (adj=adj@entry=0x5647f7cad690) at isisd/isis_adjacency.c:152
7  0x00005647f5b536f3 in isis_delete_adj (arg=0x5647f7cad690) at isisd/isis_adjacency.c:167
8  0x00007f7d6e5fe003 in list_delete_all_node (list=0x5647f7c88060) at lib/linklist.c:316
9  0x00007f7d6e5fe069 in list_delete (list=list@entry=0x5647f7c84708) at lib/linklist.c:326
10 0x00005647f5b0872e in isis_circuit_down (circuit=0x5647f7c84620) at isisd/isis_circuit.c:835
11 0x00005647f5b09f81 in isis_csm_state_change (event=event@entry=IF_DOWN_FROM_Z, circuit=circuit@entry=0x5647f7c84620, arg=arg@entry=0x5647f7c7f7a0)
   at isisd/isis_csm.c:196
12 0x00005647f5b083b0 in isis_circuit_disable (circuit=0x5647f7c84620) at isisd/isis_circuit.c:100
13 isis_circuit_del (circuit=0x5647f7c84620) at isisd/isis_circuit.c:200
14 0x00005647f5b434f5 in lib_interface_isis_destroy (args=<optimized out>) at isisd/isis_nb_config.c:2612
15 0x00007f7d6e61347a in nb_callback_destroy (errmsg_len=2, errmsg=0x7ffc0ced38d0 "", dnode=0x5647f7c948f0, event=NB_EV_APPLY, nb_node=<optimized out>,
   context=<optimized out>) at lib/northbound.c:1131
16 nb_callback_configuration (context=<optimized out>, event=event@entry=NB_EV_APPLY, change=change@entry=0x5647f7cb6680, errmsg=errmsg@entry=0x7ffc0ced38d0 "",
   errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1356
17 0x00007f7d6e6138b7 in nb_transaction_process (errmsg_len=8192, errmsg=0x7ffc0ced38d0 "", transaction=0x5647f7c94080, event=NB_EV_APPLY)
   at lib/northbound.c:1473
18 nb_candidate_commit_apply (transaction=0x5647f7c94080, save_transaction=save_transaction@entry=true, transaction_id=transaction_id@entry=0x0,
   errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:906
19 0x00007f7d6e61403d in nb_candidate_commit (context=context@entry=0x7ffc0ced38c0, candidate=<optimized out>, save_transaction=save_transaction@entry=true,
   comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc0ced38d0 "", errmsg_len=8192) at lib/northbound.c:938
20 0x00007f7d6e616ec9 in nb_cli_classic_commit (vty=0x5647f7cae160) at lib/northbound_cli.c:64
21 0x00007f7d6e6176a8 in nb_cli_apply_changes (vty=0x5647f7cae160, xpath_base_fmt=<optimized out>) at lib/northbound_cli.c:268
22 0x00007f7d6e5d918e in cmd_execute_command_real (vline=vline@entry=0x5647f7cae140, vty=vty@entry=0x5647f7cae160, cmd=cmd@entry=0x0, up_level=up_level@entry=0,
   filter=FILTER_RELAXED) at lib/command.c:971
23 0x00007f7d6e5d951d in cmd_execute_command (vline=vline@entry=0x5647f7cae140, vty=vty@entry=0x5647f7cae160, cmd=cmd@entry=0x0, vtysh=vtysh@entry=0)
   at lib/command.c:1030
24 0x00007f7d6e5d9770 in cmd_execute (vty=vty@entry=0x5647f7cae160, cmd=cmd@entry=0x5647f7cb48a0 "no ip router isis 10", matched=matched@entry=0x0,
   vtysh=vtysh@entry=0) at lib/command.c:1198
25 0x00007f7d6e6485e6 in vty_command (vty=vty@entry=0x5647f7cae160, buf=0x5647f7cb48a0 "no ip router isis 10") at lib/vty.c:483
26 0x00007f7d6e648d01 in vty_execute (vty=vty@entry=0x5647f7cae160) at lib/vty.c:1246
27 0x00007f7d6e64ba40 in vtysh_read (thread=<optimized out>) at lib/vty.c:2090
28 0x00007f7d6e64348d in thread_call (thread=thread@entry=0x7ffc0ced8310) at lib/thread.c:1958
29 0x00007f7d6e5fd4a8 in frr_run (master=0x5647f79a43d0) at lib/libfrr.c:1184
30 0x00005647f5b050f3 in main (argc=5, argv=<optimized out>, envp=<optimized out>) at isisd/isis_main.c:273
(gdb) f 3
423     isisd/isis_lsp.c: No such file or directory.
(gdb) p node
$1 = (struct listnode *) 0x110
(gdb) f 8
316     lib/linklist.c: No such file or directory.
(gdb) p list->head->data
$2 = (void *) 0x5647f7cabf20
(gdb) p list->head->next->data
$3 = (void *) 0x5647f7c9bb60
(gdb) p list->head->next->next->data
Cannot access memory at address 0x120
(gdb) p list->head->next->next
$4 = (struct listnode *) 0x110

The backtrace provided above pertains to version 8.2.2, but it seems that the same issue exists in the code of the master branch as well.

isis_reset_attach_bit() is useless because lsp_handle_adj_state_change() unconditionally calls lsp_regenerate_schedule.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
2024-05-28 17:55:58 +08:00
Andrew Cooks 0dd99a6733 ospf6d: replace OSPF6_LSA_SIZE with ospf6_lsa_size
Dropping the macro enables better compiler type checking.

The macro was not used consistently when reading the lsa size from the
header, so this change also aims to use the replacement inline function
consistently.

Keeping the inline function has (marginal) utility in that it ensures that
the endian conversion is consistently performed.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-05-28 14:07:14 +10:00
Andrew Cooks 954f2ac581 ospf6d: replace OSPF6_LSA_END with ospf6_lsa_end
Replacing the macro with an inline function enables better type
checking.

No functional change.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-05-28 14:06:25 +10:00
Andrew Cooks 4d06e27569 ospf6d: replace OSPF6_LSA_HEADER_END macro
Replacing the macro with an inline function allows the compiler to
check the parameter type.

Use the replacement function consistently to reduce the number of
open coded pointer cast plus offset calculations.

use tools/indent.py to reformat all occurences of its use.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-05-28 14:05:56 +10:00
Donatas Abraitis f7712516d8
Merge pull request #16089 from LabNConsulting/chopps/docfix
doc: add missing required newline in .rst formatting
2024-05-27 11:04:49 +03:00
Y Bharath 95426606b1 tests: Organizing variables using format method
Using format method to look code more presentable and readable

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-05-27 13:12:30 +05:30
Christian Hopps 107e3a586d doc: add missing required newline in .rst formatting
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-26 22:13:21 +00:00
Donatas Abraitis 0f5834d499 bgpd: Make sure we have enough data to handle extended link bandwidth
Extended link bandwidth is encoded inside extended community as a ipv6-address
specific extended community, but with a malformed packet we should do the
sanity check here to have enough data. Especially before doing ptr_get_be64().

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-26 18:49:22 +03:00
Donatas Abraitis 3d21e3ebf1 bgpd: Add a safety check for ecommunity_ecom2str
Just in case we have enough data according to the community unit size. It
should be 8 or 20 (for now).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-26 18:45:01 +03:00
Donatas Abraitis 496ede2495 bgpd: Convert unk_ecom to boolean
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-26 18:43:43 +03:00
Donatas Abraitis ebdbb0e3fe
Merge pull request #16070 from Pdoijode/pdoijode/lcomm-not-found-fix
bgpd: Return success if lcomm/comm/extcomm name or entry is not found
2024-05-26 17:51:29 +03:00
anlan_cs b212c4d076 doc: adjust one ospf command
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-05-25 19:46:55 +08:00
anlan_cs d15cc4741b ospfd: add instance id for one command
Add the specific instance id for the command:
```
show ip ospf [{(1-65535)$instance|vrf <NAME|all>}] graceful-restart helper [detail] [json]
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-05-25 19:44:39 +08:00
Jafar Al-Gharaibeh 52703f0c20
Merge pull request #15674 from Orange-OpenSource/ospfd-te
ospfd: Solved crash in RI parsing with OSPF TE
2024-05-24 14:30:39 -05:00