Commit Graph

20 Commits

Author SHA1 Message Date
Manoj Naragund
d214b64afa ospf6d: minor code enhancements.
Description:
code changes involve removal of increment and decrement operators
during function calls. These expressions make code less readable.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2021-10-26 00:57:03 -07:00
Donatas Abraitis
d573b8f863 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-08 08:56:42 +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
Renato Westphal
6735622c24 ospf6d: implement Type-7 default routes for NSSA areas
Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:47:13 -03:00
Renato Westphal
210429c747 ospf6d: don't generate Type-7 LSA for route created by "default-information-originate"
The route created by the "default-information-originate" command
isn't a regular external route. As such, an NSSA ABR shouldn't
originate a corresponding Type-7 LSA for it (there's a separate
configuration knob to generate Type-7 default routes).

While here, fix a small issue in ospf6_asbr_redistribute_add()
where routes created by "default-information-originate" were being
displayed with an incorrect "unknown" type.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:43:45 -03:00
Renato Westphal
242a9767f7 ospf6d: fix metric type of NSSA Type-7 LSAs
Fix wrong comparison since route->path.metric_type is always set
to either 1 or 2. The OSPF6_PATH_TYPE_EXTERNAL2 constant, whose
value is 4, refers to a route type so its usage was incorrect here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:43:45 -03:00
Renato Westphal
0c293b92ee ospf6d: do not allow an area to be stub and NSSA at the same time
That should not be allowed under any circumstance.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 11:53:36 -03:00
Renato Westphal
dd551b9d1f ospf6d: flush external LSAs when NSSA is configured
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 00:24:41 -03:00
Renato Westphal
ccfffce4a0 ospf6d: fix flushing of all LSAs when NSSA is unconfigured
Once NSSA is unconfigured on an area, all self-originated Type-7
LSAs need to be flushed. The existing code was iterating over the
LSDB in the wrong way, causing ospf6_nssa_flush_area() to flush
LSAs of all types.  Use the ALL_LSDB_TYPED_ADVRTR macro to perform
the intended iteration correctly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 00:24:41 -03:00
Renato Westphal
bb257321b2 ospf6d: don't delete area when NSSA is unconfigured
Once NSSA is unconfigured, the OSPF area should still be operational
as a normal area instead of being deleted.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 00:24:41 -03:00
Renato Westphal
d36a6a19d9 ospf6d: always unset the E-bit on NSSA ABRs
RFC 3101 - Section 2.1 says:
"(..) Interfaces associated with an NSSA will not send or receive
Type-5 LSAs on that interface but may send and receive Type-7 LSAs.
Therefore, if the N-bit is set in the options field, the E-bit must
be clear."

If the E-bit isn't cleared on an NSSA ABR, that will cause hello
packets to be dropped (due to parameters mismatch), which will
prevent the ABR from forming adjacencies with others routers in
the NSSA area.

This problem didn't affect the existing NSSA topotest by chance
of luck.  In that topotest, in the NSSA ABR, the NSSA area is
configured before any interface is associated to it. That caused
ospf6_check_and_set_router_abr() to return false, leading to
the unsetting of the E-bit. With this fix, the order in which
areas/interfaces are configured shouldn't matter because the E-bit
will always be unset on NSSA areas.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 00:24:41 -03:00
Russ White
e448fefbb4
Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisation
Ospfv3 ASBR summarisation feature
2021-07-30 06:37:50 -04:00
Russ White
3ad921a98c
Merge pull request #9193 from mobash-rasool/ospfv3-bug-fixes
ospf6d: Type-7 LSA originated with wrong sequence number
2021-07-29 15:00:55 -04:00
Mobashshera Rasool
96cad17163 ospf6d: Type-7 LSA originated with wrong sequence number
RCA: When Type-7 LSA is updated, the LSDB is searched, if the
LSA is present in the LSDB then the LSA is updated with next
sequence number and if not then it is originated with the
INITIAL sequence number.
Here while originating Type-7 LSA Process Level LSDB is searched
for instead of area level LSDB.

Fix: Search in the area level LSDB and not in the process level.

Fixes #9099

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-27 05:39:37 -07:00
Mobashshera Rasool
c405b00fcf ospf6d: install summary route NULL0 as nexthop
This is a requirement for avoiding sending traffic somewhere it was not
supposed to go: install summary route to local RIB to send traffic to
Null0.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-21 05:16:54 +00:00
Mobashshera Rasool
c3a70f6517 ospf6d: ASBR summarisation feature changes for NSSA area
1. ASBR summarisation for Type-7 LSAs are done here.

2. Fixed Code warnings

Signed-off-by: Mobashshera Rasool<mrasool@vmware.com>
2021-07-21 05:16:54 +00:00
David Lamparter
4699ad7296 ospf6d: move prefix_options from _path to _route
Prefix options are per-prefix, not per-path.  As evident by the fact
that the field is never used on ECMP paths.  Move it where it belongs.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-07-20 11:22:21 +02:00
Igor Ryzhov
edfab98f9e ospf6d: fix NSSA status update
We should update ASBR status only when the NSSA status is actually changed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-23 01:05:07 +03:00
Donald Sharp
95b3f03d89 ospf6d: Rename ospf6_is_router_abr to more accurately reflect what it does
The ospf6_is_router_abr is checking to see if ospfv3 is an abr router
and also setting values.  Let's rename it too `ospf6_check_and_set_router_abr`
to more accurately reflect what it is doing.

Additionally fix coverity #1505176 where we were not checking the return
value of ospf6_is_router_abr like we did every other time.  In this
case we don't care about the return value so indicate that we do not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-10 07:59:06 -04:00
Kaushik
ad500b22b5 ospf6d: Support for nssa in ospfv3
The following is implemented.
1. Configuring area as NSSA.
2. Generating Type 7 LSA.
3. Conversion of Type 7 to Type 5 ( Default Behavior).
4. NSSA ABR selection.

Reviewed-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Co-authored-by: Kaushik <kaushiknath.null@gmail.com>
Co-authored-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
2021-06-04 07:23:10 -03:00