Commit Graph

26761 Commits

Author SHA1 Message Date
Renato Westphal
2ad3c6dbbe ospf6d: fix lookup of translated Type-5 LSA
Type-7 LSAs and their corresponding Type-5 LSAs don't share the same
LS IDs (unlike in the case of OSPFv2). As such, do not attempt to find
a translated Type-5 LSA using the LS ID of a Type-7 LSA. Instead,
use the LS-ID stored in the OSPF routing table.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
8ee9d58b0d ospf6d: assorted code cleanup
This commits consists of several changes that positively impact
code reability without introducing any logical change.

Summary of the changes:
* Return earlier in ospf6_abr_range_update() in order to reduce one
  level of indentation;
* Remove ospf6_translated_nssa_originate() since it's nothing other
  than a useless wrapper around ospf6_lsa_translated_nssa_new();
* Change ospf6_abr_translate_nssa() to return void;
* Change ospf6_abr_process_nssa_translates() checking for NSSA areas
  before anything else;
* Remove ospf6_abr_remove_unapproved_translates_apply() since it's a
  small function that is only called in one place;
* Change ospf6_abr_check_translate_nssa() to avoid an LSDB lookup when
  the router isn't an ABR.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
7270e0edf3 ospf6d: remove unnecessary check when translating Type-7 LSA
In addition to being unnecessary, this check is problematic for the
upcoming NSSA ranges feature since NSSA ranges aren't added to the
OSPF routing table. Remove this for simplicity.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
14bb568af0 ospf6d: fix memleak when translating NSSA LSA
Stop leaking 4096 bytes for each translated LSA.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
c8093b99bf ospf6d: remove incomplete support for NSSA ranges
This code tries to summarize NSSA Type-7 LSAs using normal ranges
which are intended to summarize Type-3 LSAs only. This is not only
wrong, but the code is incomplete and lacking lots of things. Better
to remove it before implementing NSSA ranges correctly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
05da1cbfef ospf6d: fix processing of translated AS-external LSAs
The iteration performed on ospf6_abr_unapprove_translates() was
wrong since AS-external LSAs are stored in the global LSDB and not
in the area LSDBs. As such, the "unapproved" flag wasn't being set
in any translated AS-external LSA, leading them to linger forever.

Fix the LSDB iteration and make the required changes to unset the
"unapproved" flag for AS-external LSAs that shouldn't be removed.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
9e49d1aca2 ospf6d: be careful to not refresh translated Type-5 LSAs twice
The ABR task already takes care of refreshing translated Type-5
LSAs that correspond to self-originated Type-7 LSAs. There's no
need to do that in ospf_external_lsa_install() as well. The ospfd
NSSA code takes the same precaution.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
5f2fe4bb77 ospf6d: fix selection of NSSA forwarding address
Change ospf6_get_nssa_fwd_addr() to try finding a global address
on any interface of the area and not on the first one only.

Additionally, do a micro-optimization in
ospf6_interface_get_global_address() to return as soon as a global
address is found.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
576e842480 ospf6d: add "nssa" option to the "debug ospf6 lsa" command
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
d2487a6633 ospf6d: remove unnecessary code
Every received or originated LSA is automatically scheduled to be
refreshed periodically, there's no need to do that manually here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Renato Westphal
a526c05525 ospf6d: declare neighbor memtype as static
This is the only ospf6d memtype that wasn't being declared as static.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Renato Westphal
cdc12294fc ospf6d: remove unused bitfield
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Renato Westphal
19b8369ca7 ospf6d: remove redundant loop
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Renato Westphal
36be5c61b3 ospf6d: remove unguarded debug message
This debug message is of little use so remove it instead of adding
a debug guard for it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Renato Westphal
578e1c5331 ospf6d: remove unused function parameter
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:21:43 -03:00
Russ White
cf3a190ace
Merge pull request #9716 from rgirada/ospf_gr_nbr
ospfd: GR helper functionality change in helper exit
2021-10-05 19:28:40 -04:00
Russ White
334d9d259f
Merge pull request #9731 from ton31337/fix/thread_null_set
cleanup: struct thread = NULL
2021-10-05 19:27:23 -04:00
Russ White
6018f0424e
Merge pull request #9728 from donaldsharp/null_thread
Null thread
2021-10-05 19:26:00 -04:00
Russ White
a3232e63e6
Merge pull request #9733 from opensourcerouting/grpc-fix-missing
lib: fix gRPC crash on missing YANG node
2021-10-05 19:24:34 -04:00
ewlumpkin
214d8a60e1 lib: fix spelling nits in more lib files
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-10-05 21:42:57 +00:00
Jafar Al-Gharaibeh
f72b987de1
Merge pull request #9743 from pguibert6WIND/largecomm
bgpd: large community exact match fix
2021-10-05 14:30:45 -05:00
Jafar Al-Gharaibeh
aefe11f77a
Merge pull request #9711 from idryzhov/doc-ospf
doc: fix ospf distribute-list command and description
2021-10-05 14:25:42 -05:00
Jafar Al-Gharaibeh
1365d3e2f5
Merge pull request #9744 from idryzhov/isis-redist-cli
isisd: fix redistribute CLI
2021-10-05 14:22:27 -05:00
Jafar Al-Gharaibeh
e91c3433bf
Merge pull request #9725 from idryzhov/doc-debug-ospf
doc: fix debugging-ospf label
2021-10-05 11:52:32 -05:00
Jafar Al-Gharaibeh
c3b9332476
Merge pull request #9736 from ewlumpkin/comment_spelling_fixes
lib: fix spelling nits in command.h
2021-10-05 11:48:20 -05:00
Rafael Zalamena
2d28cbe661 topotests: justify code sleep
Document the `sleep` statement so people know that we are sleeping
because we are waiting for the BFD down notification. If we don't
sleep here it is possible that we get outdated `show` command results.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:41:33 -03:00
Rafael Zalamena
8ff24fd29e topotests: decrease result check frequency
Call the `show` commands less often to reduce the CPU pressure.

Also increase the wait time from 60 to 80 seconds to have spare room
for failures (4 times more). This is the latest measure wait time:

> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:40:14 -03:00
Rafael Zalamena
a6ce07852c topotests: increase OSPF convergence speed
Reduce timers so we send hello packets more often and reduce dead
interval to converge faster.

Previous test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 47.20 seconds

New test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:38:40 -03:00
Igor Ryzhov
1bfee9368a isisd: fix redistribute CLI
Currently, it is possible to configure IPv6 protocols for IPv4
redistribution and vice versa in CLI. The YANG model doesn't allow this
so the user receives the following error:
```
nfware(config-router)# redistribute ipv4 ospf6 level-1
% Failed to edit configuration.

YANG error(s):
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 YANG path: Schema location /frr-isisd:isis/instance/redistribute/ipv4/protocol.
```

Let's make CLI more user-friendly and allow only supported protocols in
redistribution commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-05 17:38:21 +03:00
Philippe Guibert
0d5b3cb9d7 bgpd: large community exact match fix
The pointer to large community was not the appropriate one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-10-05 16:24:41 +02:00
Rafael Zalamena
0f538858c2 lib: prevent gRPC assert on missing YANG node
`yang_dnode_get` will `assert` if no YANG node/model exist, so lets test for
its existence first before trying to access it.

This `assert` is only acceptable for internal FRR usage otherwise we
might miss typos or unmatching YANG models nodes/leaves. For gRPC usage
we should let users attempt to use non existing models without
`assert`ing.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 10:22:27 -03:00
rgirada
a60eab9e10 ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.
Description:
	When grace lsa received, DUT is adding
	the copy of the  lsas  to all nbrs retransmission  list as part of
	flooding procedure and subsequently incrementing the rmt counter in
	the original the LSA. This counter is supposed to be decremented
	when ack is received by nbr and the lsa  will be removed from retransmission list.

	But in our current scenario,
	Step-1:
		When GR helper is disabled, if DUT receives the grace lsa
		it adds the lsa copy to nbrs retransmission list but original
		LSA will be discarded since GR helper disabled.
	Step-2:
		GR helper enabled and DUT receives the grace lsa, as part
		of flooding process all nbrs have same copy of lsa in their
		corresponding rmt list which was added in step -1 due to this
		the corresponding rmt counter in the original lsa is not getting
		incremented.
	Step-3:
		If the same copy of the grace lsa received by DUT, It considers
		as implicit ack from nbr if the same copy of the lsa exits in its
		rmt list and subsequently  decrement the rmt counter.
	Since counter is zero (because of step-1 and 2) , it is asserting while decrement.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-10-05 04:14:37 -07:00
Igor Ryzhov
405ebe45cf yang: replace an empty pattern with a zero-length restriction
No functional difference, but `length "0"` is more comprehensible.

Suggested-by: Christian Hopps <chopps@labn.net>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-05 14:03:37 +03:00
ewlumpkin
81eb8fc749 lib: fix spelling nits in command.h
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-10-05 03:21:50 +00:00
Donald Sharp
9bfadae860 zebra: Use a bool for startup indications
Let's not pass around an int startup when all we are doing
is true/falsing it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-04 20:26:38 -04:00
Renato Westphal
5b9414484c
Merge pull request #9726 from donaldsharp/ospf6_expire
ospf6d: Ensure expire thread is properly stopped
2021-10-04 21:13:50 -03:00
Donald Sharp
0cf0069d31 zebra: On interface startup note that we are in startup
The boolean to notice that we are in startup situations
was not being properly set in one spot.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-04 16:00:27 -04:00
Sri Mohana Singamsetty
fd7abfa80b
Merge pull request #9722 from chiragshah6/zdev
zebra: add nhg id to show ip route json
2021-10-04 10:07:00 -07:00
Javier Garcia
5d5e0f5209 doc: Augmented pathd documentation.
Extend the pathd documentation with more configuration examples, more
detailed and some graphics to help understand what pathd supports.

Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
2021-10-04 18:56:47 +02:00
Donatas Abraitis
83e66fdfd6 tools: Add coccinelle script to catch thread to NULL assignments
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
62143398ce watchfrr: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
feabd51dae tests: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
bf5335cf34 pimd: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
f2b64253b8 ospf6d: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
56fb213493 nhrpd: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Donatas Abraitis
dc4a902689 ldpd: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:25:18 +03:00
Donatas Abraitis
c34d552dd5 isisd: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:24:54 +03:00
Donatas Abraitis
876968a610 bfdd: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:24:28 +03:00
Donatas Abraitis
510404d9f3 zebra: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:23:55 +03:00
Donald Sharp
fc3f4adbc6 ospf6d: Ensure expire thread is properly stopped
The lsa->expire thread is for keeping track of when we
are expecting to expire(remove/delete) a lsa.  There
are situations where we just decide to straight up
delete the lsa, but we are not ensuring that the
lsa is not already setup for expiration.
In that case just stop the expiry thread and
do the deletion.

Additionally there was a case where ospf6d was
just dropping the fact that a thread was already
scheduled for expiration.  In that case we
should just setup the timer again and it will
reset it appropriately.

Fixes: #9721
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-04 12:13:57 -04:00