Description:
Summarisation initilisation and de-init apis.
summary route table will be created as part of initilisation
at the time of ospf deamon init.
Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Currently, only default area parameter is used for initialization, but
we should use area parameters with interfaces address as well.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Move ospf initialization to the actual place where it is created.
We don't need to do that every time "router ospf" is entered.
Also remove a couple of useless checks that can never be true.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ospf_router_id_update checks for ospf->oi_running, but it'll never be 1
right after creation by ospf_new.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
OSPFD sends ARP proactively to speed up convergence for /32 networks
on a p2p connection. It is only an optimization, so it can be disabled.
It is enabled by default.
Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
On startup of both zebra and ospfd. If ospfd has not
received a valid router-id *but* has received interface
data, interfaces will not be turned on in the state
machine. When ospf finally receives a valid router-id
it would never actually kick the state machine into
action for those interfaces it has been configured for.
Modify ospf on router id changes, *if* the old
router id was INADDR_ANY *and* the interface is
operative *and* the oi->state is ISM_Down, give
it the old kick in the patooeys
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Default originate with route-map was broken. Routemap
was not getting applied for redistribute route but was
getting applied default route itself. No default route
was originated even when routemap was satisfied.
Signed-off-by: Santosh P K <sapk@vmware.com>
Fix a number of library and daemon issues so that daemons can
call frr_fini() during normal termination. Without this,
temporary logging files are left behind in /var/tmp/frr/.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Some preprocessor constants converted to enums to make the names usable
in the preprocessor.
v2: better isolation between core and vty code to make future northbound
conversion easier.
Signed-off-by: David Lamparter <equinox@diac24.net>
Well, "obviously" this condition block is pointless, since
ospf_router_id_update is called afterwards unconditionally...
(And even if it were needed, it would need to go in ospf_get too.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Add a helper function to return the name of the vrf we are in
so it can be used as part of debug strings.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Switch the zclient->interface_add functionality to have everyone
use the interface create callback in lib/if.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vrf hook handler associated to updating the vrf default name is added.
Then, when creating default ospf vrf instance, the vrf identifier will
be associated to the correct default vrf name.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Neither ospf_external_lsa_originate_timer() nor
ospf_default_originate_timer() are actually timers. They're only
executed on router-ID changes to refresh a particular LSA type.
Signed-off-by: David Lamparter <equinox@diac24.net>
no router ospf triggers to cancel all threads
including read/write (receive/send packets) threads,
cleans up resources fd, message queue and data.
Last job of write (packet) thread invoked where the
ospf instance is referenced is not running nor
the socket fd valid.
Write thread callback should check if fd is valid and
ospf instance is running before proceeding to send a
message over socket.
Ticket:CM-20095
Testing Done:
Performed the multiple 'no router ospf' with the fix
in topology where the crash was seen.
Post fix the crash is not observed.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
The shutdown of ospf was causing crashes because the shutdown
was calling a ALL_LIST_ELEMENTS_RO macro and modifying the
underlying data structures. Switch to using ALL_LIST_ELEMENTS.
This is caused by this change:
commit f9e1501aea5d429be2ecda1a3e2bde17e6ad5e4b
Author: Donald Sharp <sharpd@cumulusnetworks.com>
Date: Wed Feb 27 15:08:29 2019 -0500
ospfd: Cleanup ospf->redist and ospf->external on shutdown
Effectively my original testing for this only had one external
route and as such we would not have a crash here. It only
showed up after multiple externals have been introduced.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
These two data types were written to handle redistribute
and external data types. On shutdown cleanup the memory
allocated to these if we are doing redistribution.
This was found using valgrind.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Field vrf_id is replaced by the pointer of the struct vrf *.
For that all other code referencing to (interface)->vrf_id is replaced.
This work should not change the behaviour.
It is just a continuation work toward having an interface API handling
vrf pointer only.
some new generic functions are created in vrf:
vrf_to_id, vrf_to_name,
a zebra function is also created:
zvrf_info_lookup
an ospf function is also created:
ospf_lookup_by_vrf
it is to be noted that now that interface has a vrf pointer, some more
optimisations could be thought through all the rest of the code. as
example, many structure store the vrf_id. those structures could get
the exact vrf structure if inherited from an interface vrf context.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
When creating a ospf vrf based instance allow it to work
if the vrf has been created *before* we create the ospf
instance.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
avoid counting twice the number of areas configured, when entering back
to router ospf config node.
PR=61288
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Emmanuel Vize <emmanuel.vize@6wind.com>
when adding/removing virtual links per interface, sometimes, the ospf
virtual link can not be removed, whereas the associated area is already
removed. Do not remove the area while a virtual link is yet configured.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
1) stream allocation cannot fail
2) some warnings were removed when functions safely ignored
the calling parameters being wrong.
3) some warnings were removed when functions did not consider
the state as an error since we did not return an error code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>