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>
RFC 5187 specifies the Graceful Restart enhancement to the OSPFv3
routing protocol. This commit implements support for the GR
restarting mode.
Here's a quick summary of how the GR restarting mode works:
* GR can be enabled on a per-instance basis using the `graceful-restart
[grace-period (1-1800)]` command;
* To perform a graceful shutdown, the `graceful-restart prepare ipv6
ospf` EXEC-level command needs to be issued before restarting the
ospf6d daemon (there's no specific requirement on how the daemon
should be restarted);
* `graceful-restart prepare ospf` will initiate the graceful restart
for all GR-enabled instances by taking the following actions:
o Flooding Grace-LSAs over all interfaces
o Freezing the OSPF routes in the RIB
o Saving the end of the grace period in non-volatile memory (a JSON
file stored in `$frr_statedir`)
* Once ospf6d is started again, it will follow the procedures
described in RFC 3623 until it detects it's time to exit the graceful
restart (either successfully or unsuccessfully).
Testing done:
* New topotest featuring a multi-area OSPF topology (including stub
and NSSA areas);
* Successful interop tests against IOS-XR routers acting as helpers.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
The message about ignoring a one-way hello should only be logged
when the router is acting a helper for another one.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Description:
1. changes to process GRACE LSA packet.
2. Validation changes to enter Helper role.
3. Helper functionality during graceful restart.
Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Somehow the hello message debugging code slipped outside the debug
guard. Lets just remove it.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Some unprotected debugs need to have macro protection,
Split these into the existing covering macro section to remove
a check per-packet from the main path.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Coverity flagged the possibility of an overflow in the latency
calculation, ensure that 64 bit integers are used in the
calculation to avoid this error.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
When OSPFv3 router is configured in both default and non-default VRFs,
every packet destined to a non-default VRF is read twice. This makes it
impossible to establish neighborship because every DbDesc packet is
treated as duplicated and we end up infinitely exchanging DbDescs.
We should drop packets received in the default VRF if an interface we
received it on is bound to another VRF.
Same thing was done for OSPFv2 in 555691e.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
allow amount of work done by read and write threads in a single
invocation to be tuned to between 1 and 100 packets (default 20)
Signed-off-by: Pat Ruddy <pat@voltanet.io>
On transmit and receive calculate the time since the last hello was seen
and log a warning if it is late by more than the hello period.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
queue outgoing lsupdate messages to the interface tx FIFO and schedule
the ospf_write task to deal with them.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
enqueue outgoing dbdesc messages to the end of the tx FIFO and
schedule the ospf6_write task to deal with them.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Add per interface fifo and per instance write list as a precursor
to implementing fairer sharing of the ospf6 oscket resources.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
To ensure we read all the datagrams availabe from a socket when the
read task is scheduled, make the read helper return and error or
continue enum and loop unitl an error is received.
This requires the read from the socket to be non blocking
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Take the contents of ospf6_receive and split the funtionality that
deals with a single packet receipt and place it in a separate helper
function.
This is the first step in a refactor process to allow the ospf6_read
task to read until failure.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
The logging in ospf6 is very verbose. If you turn on logging on a scaled
system you get too many logs. The problem is that there are some errors
that occur that are hidden behind the debug flags, and to see these errors
we currently need to turn on the debug logging. This change converts these
error logs to warnings and removes the debug flags.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Patch provided by Soman K.S. with small alterations.
Signed-off-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Fix the following issues:
- if "send" is combined with "recv-hdr", only "send" is shown
- if "recv" is combined with "send-hdr", only "recv" is shown
- if both "send-hdr" and "recv-hdr" are enabled, "; header only" is shown
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This change allows the user to only log the message header and not
include all the LSAs in each packet. In a large setup printing out
all the LSAs in each packet can make the system very hard to debug.
When the user finds an issue with the adjacency not coming up or in a
specific packet type they can turn on a full dump of the message.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Same as other commits -- convert most DEFINE_MTYPE into the _STATIC
variant, and move the remaining non-static ones to appropriate places.
Signed-off-by: David Lamparter <equinox@diac24.net>
When there are too many LSA updates to be sent in a packet the code needs to
correctly clear the locks that are taken while walking the lists and then wait
for the appropriate timer to expire to continue walking the list. The routine
that was being called would not properly remove all the locks that needed to be
cleared, and would also try to incorrectly delete the lsa/route. The code now
clears the locks and leaves the lsa on the list. When the timers fire again
the code continues walking the list to send the rest of the lsas to the
neighbor.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
If area is a normal area and has adjacencies up and then the user changes
the area to a stub area, the code was leaving existing AS-External LSAs in
the database and was sending AS-External LSAs into the stub area causing
the adjacency to stay in Ex-Start. With this change we now cleanup the
AS-External LSAs that existed when area was not a stub and do not advertise
AS-External LSAs into the stub area.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Add more details to these logs to help make it easier to determine why
ospf6 adjacency is not coming up. Also make these logs show up without
having to turn on debug logging, again making it easier to debug the
misconfiguration.
Signed-off-by: Lynne Morrison <lynne@voltaio.net>
1. All the changes are related to handle ospf6 with different vrf.
2. The dependancy of global ospf6 is removed.
Co-authored-by: Kaushik <kaushik@niralnetworks.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
Let's cleanup the ospf6_sendmsg api and not pass in a pointer
to the ifindex to use. It's an integer.
Also remove the assert(*ifindex); We never use ifindex of 0
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The code pattern:
for (ALL_LSDB(lsdb, lsa)) {
remove_lsa(lsa)
}
has a use after free in ALL_LSDB, since we ask for the next pointer,
after it has been freed.
Modify the code such that we grab the next pointer before we can
possibly free it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospf6_network.h needs ospf6_top.h to be included
first.
This makes newer versions of gcc much much happier.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. The socket() call is changed to vrf_socket().
2. The ospf6 instance creation api added.
3. The global socket fd is replaced with ospf6->fd.
4. All dependency of the global socket is resolved.
5. Added the ospf6 receive timer in the global structure.
6. Performed the thread off on receive timer when we do "no router ospf6".
Co-authored-by: harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
1. Removed the VRF_DEFAULT dependency from ospf6d.
2. The dependency on show command still exist
will be fixed when the ospf6 master is available.
Co-authored-by: Harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
This reverts commit 0f9f74baeb.
This commit was causing crashes and the goal of this commit
was to make coverity sanity happy. I'd rather have coverity
sad and not have ospfv3 crash
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospf6_lsa_unlock may free the lsa data structure as such
we cannot use the passed in data structure after freeing it.
Provide a mechanism to know if the data has been freed
using the same usage patterns of other _unlock functions
in FRR.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>