Commit Graph

30591 Commits

Author SHA1 Message Date
sarita patra
028583e9e0 pim6d: Adjust rpf_addr in pim_upstream
In this PR, we are handling the pim_upstream
after rpf_addr modified from prefix to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
sarita patra
b63192cfc2 pim6d: Adjust rpf_addr in rp_info
In this PR, we are handling the rp_info
after rpf_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
sarita patra
66344d3d52 pim6d: Adjust rpf_addr rpf code
In this PR, we are handling the pim_rpf code
after rpf_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
sarita patra
490e5b181c pimd: modify rpf_addr from prefix to pim_addr
Currently rpf_addr is of type struct prefix, but it's always
a /32 host prefix. So changing it to pim_addr in order to support both
IPV4 and IPV6.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
Donatas Abraitis
7650a8d638
Merge pull request #9307 from SaiGomathiN/sai-nht
pimd: json support for nexthop
2022-07-06 12:32:48 +03:00
David Lamparter
c6a89c8ef5 zebra: IIF/OIF are not used in MR RTM_GETROUTE
The multicast routing RTM_GETROUTE command does not use IIF/OIF
attributes, and the IPv6 version will refuse them with an error due to
being new netlink API and thus using strict validation.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-06 11:29:56 +02:00
David Lamparter
31071fe357 zebra: netlink MR is a rtmsg, not ndmsg
These two structs happen to be the same size and have the family field
in the same spot, but the correct one to use here is rtmsg not ndmsg.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-06 11:23:06 +02:00
David Lamparter
afeb8524e2 zebra: correctly ignore multicast nl msgs
zebra does not care about _notifications_ from the kernel regarding
multicast routing;  we only use the MR netlink API to request stats from
the kernel by actively sending a RTM_GETROUTE.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-06 11:19:05 +02:00
David Lamparter
255a76a56a lib: use assume() for SA fixing, add explainer
Literally 4 minutes after hitting merge on Mark's previous fix for this
I remembered we have an `assume()` macro in compiler.h which seems like
the right tool for this.

(... and if I'm touching it, I might as well add a little text
explaining what's going on here.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-06 10:48:56 +02:00
David Lamparter
5adddad38f
Merge pull request #11534 from mjstapp/fix_typesafe_sa
lib: fix SA warning in typesafe code
2022-07-06 10:35:24 +02:00
Iqra Siddiqui
42427e3908 bgpd: Update msg not being sent on removing route-map from default-originate config
Description:
- On removing just the route-map from the default-originate config,
  update message is not sent to the peer,
  and the properties set by route-map persists on peer's end,
  until we do a clear bgp.

Fix:
- The flag which is set when default route is originated,
  should be unset once "neighbor X.X.X.X default-orginate",
  to remove route-map from "neighbor X.X.X.X default-orginate route-map Y",
  so as to trigger the flow for sending an update.

Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-07-06 05:38:35 +00:00
Abhinay Ramesh
a9ae9fb5bb bgpd: fix route-map update and delete route-map
Description:
- When there is change in route-map properties after
  setting the route-map with default route, changes
  will not reflect.
- When route-map associated with default-originate is
  deleted, default route doesn't get withdrawn.

- When there is change in route-map default-originate flow
  does not get triggered.

Fix:
- One of the flags needs to be unset for default-originate
  flow to get triggered after change in route-map.
  Have unset the flag, so that default originate flow can
  be triggered.

Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-07-06 05:38:35 +00:00
Iqra Siddiqui
46c4f05bb6 bgpd: Inconsistencies in SNT counters with default-originate
Description:
Change is intended for fixing the inconsistencies present
while adjusting the SNT counters with default originate.

- SNT counter gets incremented on every change of policy associated
  with default-originate, leading to inconsistencies.
- This fix has been added to ensure that the SNT counters gets
  incremented and decremented only once during the creation and
  deletion workflow of default-originate, and prevents
  incrementing the counter during update flow.

Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-07-06 05:38:35 +00:00
Donald Sharp
e894ef7e77
Merge pull request #11524 from kuldeepkash/multicast_pim_bsm
tests: Fix for multicast_pim_bsm_topo1 key error
2022-07-05 19:53:30 -04:00
Mark Stapp
f580074e61 lib: fix SA warning in typesafe code
There's a nagging SA warning, at least with the scan-build
version we use in the FRR CI.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-07-05 16:31:41 -04:00
Pushpasis Sarkar
96929d759f
Merge pull request #11519 from opensourcerouting/feature/turn_on_reserved_ip_ranges
Allow using IPv4 (Class E) IP ranges for daemons
2022-07-05 20:57:37 +05:30
Russ White
211f1157ee
Merge pull request #11494 from ak503/ospf_bfd
ospfd: set/unset bfd profile
2022-07-05 09:51:28 -04:00
Russ White
1dc900fe27
Merge pull request #11502 from donaldsharp/zebra_dplane_fini
zebra: make rib_process_dplane_results own ctx freeing
2022-07-05 09:49:02 -04:00
Russ White
c718a13d60
Merge pull request #11508 from louis-6wind/lsp-parse
isisd: fix infinite loop when parsing LSPs
2022-07-05 09:48:19 -04:00
Russ White
2de5a31e39
Merge pull request #11515 from opensourcerouting/fix/cond_advertisements_update_type
bgpd: Start conditional advertisements instantly if we configure them
2022-07-05 09:44:44 -04:00
Russ White
ede13e3b9c
Merge pull request #11517 from louis-6wind/advert-map
topostest: bgp_conditional_advertisement cleanup
2022-07-05 09:37:41 -04:00
ARShreenidhi
6f5aea0eb6 tests : bgp default originate testcases
this commit containes 2 testcases that covers
1. Default originate behaviour on restarting the BGP daemon and FRR router
2. Default Originate behaviour on shut no-shutting the interface

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-07-05 13:28:26 +00:00
Donatas Abraitis
ab3d497ad5
Merge pull request #11527 from mobash-rasool/fixes
pimd: Remove unused extern pim_channel_oil_list
2022-07-05 16:19:05 +03:00
Rafael Zalamena
da82615d4b
Merge pull request #11371 from rampxxxx/feat_bfd_ipv4_echo_fwd_path
bfdd: add IPv4 BFD Echo support that loops pkts in forwarding plane
2022-07-05 07:10:11 -03:00
Mobashshera Rasool
a626be65c5 pimd: Remove unused extern pim_channel_oil_list
Removing the extern declaration of pim_channel_oil_list since
its not required anymore.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-07-05 02:25:03 -07:00
Kuldeep Kashyap
296b75ed2a tests: Fix for multicast_pim_bsm_topo1 key error
Issue was reported by Donald, we were hitting
with key not found error and execution was
stopped, which is fixed by this PR.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-04 23:00:31 -07:00
David Lamparter
87101cd399
Merge pull request #11507 from donaldsharp/setsockopt_changes 2022-07-04 10:38:25 +02:00
Sarita Patra
891b1d8fb7 pim6d: fix no ipv6 pim drpriority
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-07-03 23:07:23 -07:00
Sarita Patra
596b5a8a4c pim6d: configure ipv6 pim drpriority
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-07-03 23:05:23 -07:00
Donatas Abraitis
484cc1bd97
Merge pull request #11514 from donaldsharp/zebra_odds_and_ends
Zebra odds and ends
2022-07-04 08:11:29 +03:00
Donatas Abraitis
23396c6486
Merge pull request #11520 from donaldsharp/zebra_debug_queue
zebra: Add a subqueue2str function to give more useful data in debugs
2022-07-03 22:10:53 +03:00
Donald Sharp
7a96ccc7b4 zebra: Add a subqueue2str function to give more useful data in debugs
New output example:

2022-07-03 09:40:29.310 [DEBG] zebra: [JF0K0-DVHWH] rib_meta_queue_add: (0:254):4.5.6.8/32: queued rn 0x55937f586ee0 into sub-queue Kernel Routes
2022-07-03 09:40:29.321 [DEBG] zebra: [HH6N2-PDCJS] default(0:254):4.5.6.8/32 rn 0x55937f586ee0 dequeued from sub-queue Kernel Routes

Let's make it a bit more human readable.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-03 09:41:31 -04:00
Donatas Abraitis
1db8b179e4
Merge pull request #11505 from SaiGomathiN/watermark
pim6d: Fix the todo items in ipv6 watermark limit CLI
2022-07-02 21:36:42 +03:00
Donatas Abraitis
bc7e6a17d4 tests: Check if we allow using IPv4 Class E for peering/next-hops
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:38:14 +03:00
Donatas Abraitis
70632160e9 bgpd: Reuse ipv4_martian() when validating BGP next-hop
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:38:14 +03:00
Donatas Abraitis
e66b8e3942 lib: Convert ipv4_martian to bool
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:38:14 +03:00
Donatas Abraitis
d80132b137 lib: Allow using IPv4 (Class E) reserved block if enabled
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:38:13 +03:00
Donatas Abraitis
ac156aecb5 lib, vtysh: Add allow-reserved-ranges global command
It will be used to allow/deny using IPv4 reserved ranges (Class E) for Zebra
(configuring interface address) or BGP (allow next-hop to be from this range).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:24:52 +03:00
Donatas Abraitis
a28af47280 doc: Add allow-reserved-ranges global command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:23:14 +03:00
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