Commit Graph

29152 Commits

Author SHA1 Message Date
Donald Sharp
c38b527509
Merge pull request #11516 from opensourcerouting/freebsd-rtsock-enobufs
zebra: handle FreeBSD routing socket ENOBUFS
2022-07-01 13:49:44 -04:00
Louis Scalbert
90557c3fce topostest: bgp_conditional_advertisement cleanup
The bgp_conditional_advertisement topotest runs all the test cases in
the same function. It is not easy to debug it because the pytest
"--pause" argument does not make breaks between test cases.

Dispatch the test-cases into functions to benefit from the "--pause"
feature.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-07-01 16:49:52 +02:00
Rafael Zalamena
26e95efa4d zebra: handle FreeBSD routing socket ENOBUFS
This is a slightly modified version of Hiroki Sato's version:
9ca79c941f

Handle the `ENOBUFS` on a OS basis since it could have been implemented
differently (OpenBSD for an example uses `RTM_DESYNC`).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-07-01 10:21:41 -03:00
Donatas Abraitis
06bb44c884 bgpd: Start conditional advertisement timer instantly
Do not wait for the configured timer to expire if we enable advertise-map.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 15:22:06 +03:00
Quentin Young
ecf2b628d9 bgpd: rename update_type enum values
These values were named WITHDRAW and UPDATE. Yeah, you guessed it, those
are already #define's elsewhere (bgp_debug.h). Hilarity ensues.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-07-01 15:22:04 +03:00
Donald Sharp
b09388f0ea zebra: Add more cases to proto2zebra for understanding kernel routes
Just some missing ones.  Make zebra stop complaining, was getting
some messages from proto2zebra when doing testing, let's clean
that up from happening.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-01 07:59:53 -04:00
Donald Sharp
88b0baa648 zebra: move allow_delete to zrouter.allow_delete
Instead of having global allow_delete move it to
where it belongs in the zrouter data structure.

Additionally show this data in `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-01 07:59:53 -04:00
Donald Sharp
c3dcd24bc2 zebra: Notice to end operator when a failure happens
When reading a multipath route and we detect an encoding
error from the kernel( yeah I don't think so either ),
let's tell the operator what happened to that route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-01 07:59:53 -04:00
Donatas Abraitis
820e696f84
Merge pull request #11488 from donaldsharp/capabilities
lib: Allow downgrade of all caps when none are specified
2022-07-01 09:35:14 +03:00
Louis Scalbert
8c8a5a02fa isisd: fix infinite loop when parsing LSPs
Fixing the crash:

> #0  0x0000560aa80f8e30 in lspdb_const_find (h=<error reading variable: Cannot access memory at address 0x7fff5e95efe8>, item=<error reading variable: Cannot access memory at address 0x7fff5e95efe0>) at ./isisd/isis_lsp.h:64
> #1  0x0000560aa80f8e9d in lspdb_find (h=0x560aaa1ed3b8, item=0x7fff5e95f050) at ./isisd/isis_lsp.h:64
> #2  0x0000560aa80f92f9 in lsp_search (head=0x560aaa1ed3b8, id=0x7fff5e95f200 "") at isisd/isis_lsp.c:100
> #3  0x0000560aa8113d69 in spf_adj_list_parse_tlv (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, id=0x560aad331a78 "", desig_is_id=0x0, pseudo_metric=0, metric=3, oldmetric=false, subtlvs=0x0) at isisd/isis_spf.c:1330
> #4  0x0000560aa811419d in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1429
> #5  0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #6  0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> (...)
> #65507 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65508 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65509 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65510 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65511 0x0000560aa8114313 in isis_spf_build_adj_list (spftree=0x560aaa1f09d0, lsp=0x560aaa1f4e50) at isisd/isis_spf.c:1455
> #65512 0x0000560aa8114f09 in isis_run_spf (spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1775
> #65513 0x0000560aa8115057 in isis_run_spf_with_protection (area=0x560aaa1ed3b0, spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1801
> #65514 0x0000560aa8115311 in isis_run_spf_cb (thread=0x7fff5f15e5a0) at isisd/isis_spf.c:1859
> #65515 0x00007f90bac66dcc in thread_call (thread=0x7fff5f15e5a0) at lib/thread.c:2002
> #65516 0x00007f90bac013ee in frr_run (master=0x560aa9f5cb40) at lib/libfrr.c:1196
> #65517 0x0000560aa80e7da2 in main (argc=2, argv=0x7fff5f15e7b8, envp=0x7fff5f15e7d0) at isisd/isis_main.c:273

The fix is similar to the crash fix included in d9884a758c
("isisd: Prepare IS-IS for Link State support"). The fix was:

> diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
> index 94353a5bc8..92d329f035 100644
> --- a/isisd/isis_lsp.c
> +++ b/isisd/isis_lsp.c
> @@ -2166,7 +2178,7 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
>  	if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
>  		return LSP_ITER_CONTINUE;
>
> -	/* Parse main LSP. */
> +	/* Parse LSP */
>  	if (lsp->tlvs) {
>  		if (!fabricd && !pseudo_lsp && family == AF_INET
>  		    && mtid == ISIS_MT_IPV4_UNICAST) {
> @@ -2236,13 +2248,17 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
>  		}
>  	}
>
> -	/* Parse LSP fragments. */
> -	for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
> -		if (!frag->tlvs)
> -			continue;
> +	/* Parse LSP fragments if it is not a fragment itself */
> +	if (!LSP_FRAGMENT(lsp->hdr.lsp_id))
> +		for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
> +			if (!frag->tlvs)
> +				continue;
>
> -		isis_lsp_iterate_ip_reach(frag, family, mtid, cb, arg);
> -	}
> +			if (isis_lsp_iterate_ip_reach(frag, family, mtid, cb,
> +						      arg)
> +			    == LSP_ITER_STOP)
> +				return LSP_ITER_STOP;
> +		}
>
>  	return LSP_ITER_CONTINUE;
>  }

Fixes: 7b36d36e0e ("isisd: make the SPF code more modular")
Fixes: 5e56a50559 ("isisd: fix infinite loop when parsing LSPs")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-06-30 16:45:32 +02:00
Louis Scalbert
cab7be7d5b Revert "isisd: fix infinite loop when parsing LSPs"
This reverts commit 5e56a50559.
2022-06-30 16:20:49 +02:00
Donald Sharp
cc408c062b zebra: Realign SOL_NETLINK to warn when FRR does not have it
There exists a possibility that an end operator has choosen
to compile FRR on an extremely old KERNEL that does not support
the SOL_NETLINK sockopt call.  If so let's note it for them
instead of stuff silently not working.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-30 08:03:02 -04:00
Donald Sharp
fe953d7cde zebra: Correct implication of SOL_NETLINK NETLINK_ADD_MEMBERSHIP usage
The usage of SOL_NETLINK for adding memberships of interest is
1 group per call.  The netink_socket function implied that
the call could be a bitfield of values.  This is not correct
at all.  This will trip someone else up in the future when
a new value is needed.  Let's get it right `now` before
it becomes a problem.

Let's also add a bit of extra code to give operator a better
understanding of what went wrong when a kernel does not
support the option.

Finally as a point of future reference should FRR just switch
over to a loop to add the required loops instead of having
this bastardized approach of some going in one way and some
going in another way?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-30 07:57:55 -04:00
Sai Gomathi N
fc19632faa pimd, pim6d: Adding json support for show ipv6 nexthop
Moving the reusable code of pim_show_nexthop apis to common file
pim_cmd_common.c file and adding the json support for show ipv6 pim nexthop

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30 04:09:14 -07:00
nsaigomathi
573a01ba19 pimd: json support for nexthop
Problems Identified:
show ip pim nexthop cli didn't have json extension and
show ip pim vrf all upstream have improper json format

Description:
show ip pim nexthop command shows the nexthops that are being used.
Added json support for the command.
show ip pim vrf all upstream displays upstream information for all vrfs about a S,G mroute.
Formatted the json structure for this command.

Signed-off-by: nsaigomathi <nsaigomathi@vmware.com>
2022-06-30 03:22:19 -07:00
Sai Gomathi N
889d43b1e6 pim6d: Implementing mld watermark-warn CLI completely
Implementing the TBD of watermark-warn CLI for IPv6 MLD
This command can be use to warn the user
when more than the desired limit of groups gets configured.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30 02:05:13 -07:00
Sai Gomathi N
229a20e2ad pimd: Modifying member of pim_instance to accomodate IPv6 changes
Modifying igmp_watermark_limit of struct pim_instance
to gm_watermark_limit which is to be used for both IGMP and MLD.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30 01:49:54 -07:00
Dmitrii Turlupov
f3fd7196eb ospfd: set/unset bfd profile
Before this patch we can enable 'ip ospf bfd' via '[no] ip ospf bfd profile ...' commads.
After patch '[no] ip ospf bfd profile ...' actual only if 'ip ospf bfd' is set.

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2022-06-30 10:56:34 +03:00
Donald Sharp
f00b37e710 zebra: make rib_process_dplane_results own ctx freeing
The rib_process_dplane_results function was having each
sub function handler process the results and then
free the ctx.  Lot's of functionality that needs to remember
to free the context.  Let's just free it in the main loop.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-29 15:24:20 -04:00
Donald Sharp
88be4045c9 lib: Allow downgrade of all caps when none are specified
Staticd when run tells privs.c that it does not need any
priviledges.  The lib/privs.c code was not downgrading
any and all permissions it may have been given at startup.

Since we don't need any let's actually tell the system that
FRR does not need the capabilities anymore in the case
where a daemon does not ask for any cap's.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-29 14:40:57 -04:00
Donald Sharp
03c95c540f
Merge pull request #11493 from patrasar/pim_reg_stop_fix
pimd: Register stop message sent with mask 32
2022-06-29 13:02:27 -04:00
Sarita Patra
8e51ca271e pimd: Register stop message sent with mask 32
As per RFC 4601 section 4.9.4, For Register-Stops,
the Mask Len field contains full address length * 8
(e.g. 32 for IPv4 native encoding) (e.g. 128 for IPv6),
if the message is sent for a single group

The issue is seen after 10356, so fixed now.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-06-29 06:34:19 -07:00
Donatas Abraitis
fd878267a3
Merge pull request #11428 from SaiGomathiN/pimdebug
pimd,pim6d: Change the show running commands based on address family
2022-06-29 14:27:45 +03:00
Russ White
9a4b3d5467
Merge pull request #11486 from taspelund/bgp_timer_always_on
bgpd: include 0 in configured hold/keepalive
2022-06-28 16:54:09 -04:00
Donald Sharp
a747bf5f45
Merge pull request #11484 from opensourcerouting/fix/allow_using_bgp_roles_for_peer_groups
bgpd: Make sure peer-groups/unnumbered work too with BGP role
2022-06-28 14:31:48 -04:00
Donald Sharp
f060671983
Merge pull request #11481 from mobash-rasool/fixes
pimd: Querier to non-querier transition to be ignored (ANVL Conformance fix)
2022-06-28 13:49:47 -04:00
Donatas Abraitis
83f9be4291
Merge pull request #11456 from ARShreenidhi/default_originate_vrf_automation
tests : bgp-default-originate in vrf scenerio
2022-06-28 18:51:05 +03:00
Donatas Abraitis
7dddd1f733 bgpd: Make sure peer-groups/unnumbered work too with BGP role
Just adding a support for peer-groups, because now it's not possible to
configure BGP role for peer-groups.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-28 18:32:11 +03:00
Trey Aspelund
e93d5c298d bgpd: include 0 in configured hold/keepalive
The default keepalive/hold timers are always exposed via this commit:
```
commit 9b1b96233d (origin/bgp_timer_always_on)
Author: Trey Aspelund <taspelund@nvidia.com>
Date:   Mon Jun 27 23:20:33 2022 +0000

    bgpd: always display keepalive/hold intervals

    `show bgp neighbors <peer> [json]` was only displaying the configured
    keepalive and holdtime intervals when they differed from the default
    values.  Since default config is still config, let's make sure these
    values are always displayed.

    Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
```

However it mistakenly changed the logic to only display the peer's
timers if the configured value was non-zero.  This updates the logic to
check PEER_FLAG_TIMER to determine if the values were configured,
given 0 is a valid value (to disable keepalives).

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-06-28 14:58:51 +00:00
Lou Berger
613025ef10
Merge pull request #11093 from donaldsharp/allow_martians
Allow martians
2022-06-28 10:38:57 -04:00
ARShreenidhi
034c15b946 tests : bgp-default-originate in vrf scenerio
testcase in this script covers the default originate behavious in VRFs

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-28 12:48:19 +00:00
Mobashshera Rasool
8d9e46a727 pimd: Querier to non-querier transition to be ignored
Fixing IGMPv2 ANVL Conformance issue 3.10

As per RFC 2236 section 3, when the leave message is received at a querier,
it starts sending Query messages for "last Member Query Interval*query count"
During this time there should not be any querier to non-querier
transition and the same router needs to send the remaning queries.

Currently the code is handling this scenario only when leave is receive
for a group and the query is received for the same group.
But we need to handle it irrespective of group since the querier
election is based on interface and not group.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-28 05:07:27 -07:00
mobash-rasool
d841284b70
Merge pull request #11454 from routingrocks/evpn_clag_frrlogs
Zebra EVPN Debug: Fixing log flooding when disabling MLAG leaf config…
2022-06-28 17:32:10 +05:30
lynnemorrison
0fb24aa031 tests: update timers in BFD VRF test
Increase BFD Echo timers to make test stable.

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2022-06-28 07:53:30 -04:00
Russ White
5295200043
Merge pull request #11474 from donaldsharp/dp-dpdk
Dp dpdk
2022-06-28 07:33:22 -04:00
Donald Sharp
20e8450396
Merge pull request #11479 from AbhishekNR/gm_enable
pim6d: Changing igmp_enable to gm_enable.
2022-06-28 07:30:32 -04:00
Russ White
e7e06760f6
Merge pull request #11478 from opensourcerouting/fix/permissions_stale_gh
github: Set strict permissions for stale actions for Github
2022-06-28 07:02:40 -04:00
Russ White
a789fb0896
Merge pull request #11482 from donaldsharp/netconf_work
Netconf work
2022-06-28 07:02:01 -04:00
Russ White
fe9a6ecc4a
Merge pull request #11483 from taspelund/bgp_timer_always_on
bgpd: always display keepalive/hold intervals
2022-06-28 07:00:30 -04:00
Russ White
03f064dacb
Merge pull request #11236 from LabNConsulting/ziemba/topotest-srte-route-routemap-policy-order
topotests/isis_sr_te_topo1: test out-of-order route/route-map changes
2022-06-28 06:57:38 -04:00
Igor Ryzhov
f50249661a
Merge pull request #11434 from donaldsharp/more_test_fixups
Crash fix and test fix and some cleanup
2022-06-28 13:06:35 +03:00
mobash-rasool
d942df2abf
Merge pull request #11480 from opensourcerouting/fix/peer_flags_luu
bgpd: Use uin64_t for peer->flags
2022-06-28 12:08:09 +05:30
Trey Aspelund
9b1b96233d bgpd: always display keepalive/hold intervals
`show bgp neighbors <peer> [json]` was only displaying the configured
keepalive and holdtime intervals when they differed from the default
values.  Since default config is still config, let's make sure these
values are always displayed.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-06-27 23:37:21 +00:00
Donald Sharp
385d37ab31 zebra: Add ability for netconf dplane to handle global values
Add the ability for the netconf dplane code to handle
the global NETCONFA_IFINDEX_DEFAULT and NETCONF_IFINDEX_ALL
values.  Then store our interested values when we get
them from the kernel as well as being able to display
them to the end operator.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-27 16:30:20 -04:00
lynnemorrison
57485b0b4f bfdd: add IPv4 BFD Echo support that matches RFC
Modify the existing BFD Echo code to send an Echo message that will
be looped in the peers forwarding plane.   The existing Echo code
only works with other FRR implementations because the Echo packet
must go up to BFD to be turned around and forwarded back to the
local router.    The new BFD Echo code sets the src/dst IP of the
packet to be the local router's IP and sets the dest MAC to be the
peers MAC address.    The peer receives the packet and because it
is not it's IP address it forwards it back to the local router.

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2022-06-27 16:21:08 -04:00
Donald Sharp
d53dc9bd81 zebra: Pass afi received for netconf updates
When Zebra receives the netconf update an afi is passed
let's seperate that out and track the v4/v6 specific data
to save and store appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-27 15:26:13 -04:00
Donald Sharp
4c84aa5ebd zebra: mc_forwarding was being sent but not retrieved across dataplane
The mc_forwarding status for an interface was being sent but not
properly retrieved on the zebra master side of the dplane.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-27 15:04:21 -04:00
Donatas Abraitis
83194f394b bgpd: Use uin64_t for peer->flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-27 17:22:54 +03:00
Abhishek N R
4fecac21cb pim6d: Changing igmp_enable to gm_enable.
Modified variable name so that it can be reused in mld.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-27 05:52:02 -07:00
Anuradha Karuppiah
3c6732e43d zebra: add documentation for the DPDK dataplane plugin
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-06-27 08:08:02 -04:00