Commit Graph

1591 Commits

Author SHA1 Message Date
Donald Sharp
42e122614b
Merge pull request #7448 from mjstapp/fix_gcc10_formats
* : clean up format specifiers for gcc-10
2020-11-10 11:23:02 -05:00
Mark Stapp
72327cf3e7 * : clean up format specifiers for gcc-10
gcc 10 complains about some of our format specs, fix them. Use
atomic size_t in thread stats, to work around platform
differences.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-04 16:56:17 -05:00
Donald Sharp
fddbafcc9e ospfd: Cleanup some clang sa issues
This commit tells the compiler we are intentionally ignoring
the lsa value returned and not doing anything with ret.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 11:47:57 -05:00
Olivier Dugeon
e035e7142e
Merge pull request #6795 from rgirada/ospf_db_json
ospfd: json support for ospf database command.
2020-11-03 15:42:03 +01:00
rgirada
ac8c9518ab ospfd: OSPF external summarisation debug support
Description:
	Changes to enable/disable debugs for external
	LSA sumarisation.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:34:14 -08:00
rgirada
960417cf06 ospfd: OSPF external summarisation scenarios
Description:
	Aggergation handled in the following scenarios.
	1. Route update from Zebra.
	2. Refresh external LSA.
	3. Processing routemap update.
	4. Self originated lsa processing.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:34:11 -08:00
rgirada
53e44d0594 ospfd: OSPF external LSA summarisation show commands
Description:
	The below show command introduced to diplay all configured
	summary addresss information along with matching corresponding
	external route information.

	show ip ospf [vrf <NAME|all>] summary-address [detail] [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:06:12 -08:00
rgirada
423e71c45a ospfd: External LSA summarisation config commands.
Description:
	The following config commands introduced for external route
	aggregation.

	[no] summary-address A.B.C.D/M [tag (1-4294967295)]
	[no] summary-address A.B.C.D/M no-advertise
	aggregation timer (5-1800)
	no aggregation timer

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:02:37 -08:00
rgirada
63f0e9415c ospfd: ospf summarisation core handlers
Description:
Apis for creating/deleting aggregate routes.
Origination of summary route on behalf of matched external routes.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 21:17:26 -08:00
rgirada
ad7222b76c ospfd: Summarisation init/de-init.
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>
2020-11-01 21:13:20 -08:00
rgirada
cb2bc4cb02 ospfd: summarisation specific data structures.
Description:
Data structures definitions for summary route.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 21:10:31 -08:00
rgirada
f328dc606e ospfd: json support for ospf database command.
Description:
Added json support to ospf lsdb command and its subcommands.
Added json to the following sub commands.
show ip ospf  database json
show ip ospf  database router json
show ip ospf  database network json
show ip ospf  database external json
show ip ospf  database summary json
show ip ospf  database asbr-summary json
show ip ospf  database nssa-external json
show ip ospf  databas max-age json
show ip ospf  database self-originate json

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 08:25:40 -08:00
Mark Stapp
93ca501b61
Merge pull request #7418 from donaldsharp/manuall
*: spelling fixes
2020-10-30 08:16:46 -04:00
Donald Sharp
02c671af40 *: Correct spelling stuff
Pretty obvious.  WE R SPELL GOOD

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-29 16:16:00 -04:00
Mark Stapp
416168835b ospfd: clean up SA warning in ospf_finish_final()
Clean up an SA warning.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-29 12:02:40 -04:00
Santosh P K
5a066545da
Merge pull request #7301 from idryzhov/ospf-fixes
many ospfd fixes
2020-10-28 20:26:02 +05:30
Donald Sharp
a43f7e4d95
Merge pull request #7173 from ckishimo/force
ospfd: fix lsa type-7 continuously refreshed
2020-10-27 11:22:23 -04:00
Olivier Dugeon
0ab14b484c
Merge pull request #7341 from kssoman/nssa_fix
ospfd: External LSA not flushed when area is configured as NSSA
2020-10-27 15:30:31 +01:00
Soman K S
44445dee9a ospfd: External LSA not flushed when area is configured as nssa or stub
Issue:
When the ospf area is changed from default to nssa or stub, the previously
advertised external LSAs are not removed from the neighbor.
The LSAs remain in database till maxage timeout.

Fix:
Advertise the external LSAs with age set to maxage and flood to the
nssa or stub area.

Signed-off-by: kssoman <somanks@gmail.com>
2020-10-24 18:05:40 +05:30
Donald Sharp
4d347f0cb6
Merge pull request #7380 from Orange-OpenSource/ospf-sr
Add more Segment Routing controls
2020-10-23 21:28:06 -04:00
Olivier Dugeon
a351b3e4d2 ospfd: Add more Segment Routing controls
When Segment Routing is not enabled, some related output messages are
printed on the console especially when Segment Routing Debug is enabled.

This patch adds additional controls to check whether segment routing
is enabled or not.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-10-23 19:01:15 +02:00
Mark Stapp
5047884528 *: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 12:16:52 -04:00
Mark Stapp
b3d6bc6ef0 * : update signature of thread_cancel api
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>
2020-10-23 08:59:34 -04:00
Mark Stapp
96b663a381 ospfd: replace inet_ntoa
Stop using inet_ntoa, use %pI4 etc or inet_ntop instead

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22 13:37:25 -04:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Russ White
742e0f4428
Merge pull request #7206 from ckishimo/fix7086
ospfd: flush type 5 when type 7 is removed
2020-10-20 09:28:13 -04:00
Donald Sharp
ae32e1c298 ospfd: Convert to using %pFX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-17 13:39:10 -04:00
Donald Sharp
c10e14e96d *: Create/Use accessor functions for lock count
Create appropriate accessor functions for the rn->lock
data.  We should be accessing this data through accessor
functions since it is private data to the data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-17 13:39:10 -04:00
Donald Sharp
2d9b665e54
Merge pull request #7322 from Orange-OpenSource/ospf-sr
ospfd: Store neighbor Adjacency SID in SR database
2020-10-17 13:17:50 -04:00
Donald Sharp
5aa303c9b0
Merge pull request #7304 from volta-networks/fix_vs_1811
ospfd: fix invocation of ospfTrapNbrStateChange
2020-10-15 11:17:10 -04:00
Babis Chalios
8ab046a480 ospfd: fix invocation of ospfTrapNbrStateChange
ospfNbrStateChange is generated when the state of neighbor regresses or
it progresses to a terminal state. When transitioning to or from Full
state on non-broadcast multi-access and broadcast networks the trap
should be sent by the designated router. This last condition was not
taken into account when checking for the conditions of generating the
trap.

Fixes volta/volta-stack#1811

Signed-off-by: Babis Chalios <mail@bchalios.io>
2020-10-15 11:16:01 +02:00
Donald Sharp
2c6592c140
Merge pull request #7309 from mjstapp/fix_ospf_gr_reasons
ospfd: make GR reason string production safer
2020-10-14 19:19:39 -04:00
Mark Stapp
d81937481d ospfd: fix SA warnings in ospfd, ospfclient
Fix some SA warnings in ospf GR and ospfclient code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-14 13:41:00 -04:00
Mark Stapp
d05d5280e6 ospfd: make reason string production safer
Use to-string functions for GR message codes instead of raw
string array indexing; the values used can come in packets
and are not validated.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-14 12:51:52 -04:00
Olivier Dugeon
edb368e930 ospfd: Store neighbor Adjacency SID in SR database
For TI-LFA, it is necessay to known the Adjacency SID advetise by the nieghbor
routers. However, the current Segment Routing code skip neighbor Adjacency SID
and thus, don't store them into the Segment Routing database.

This PR takes care of neighbor Adjacency SID by allowing to store them in the
Segment Routing database. Corresponding MPLS table entry is only configured if
the advertised Adjacency SID is global i.e. with L-Flag unset.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-10-14 14:17:58 +02:00
Donatas Abraitis
9ed5b22e13
Merge pull request #7283 from donaldsharp/thread_off_semantics
*: Use proper semantics for turning off thread
2020-10-14 14:50:08 +03:00
Igor Ryzhov
15bf52d3e2 ospfd: remove all "ip ospf area" params when clearing instance
Currently, only default area parameter is cleared, but we should do the
same for all area parameters with interface addresses.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-14 02:40:30 +03:00
Igor Ryzhov
68e1c44972 ospfd: use all "ip ospf area" params for ospf initialization
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>
2020-10-14 02:40:30 +03:00
Igor Ryzhov
0549eeda3d ospfd: don't initialize ospf every time "router ospf" is used
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>
2020-10-14 02:22:16 +03:00
Igor Ryzhov
cbf1568110 ospfd: correctly process interface creation/destruction
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-14 02:22:16 +03:00
Igor Ryzhov
eb364867d4 ospfd: fix check for network configuration
We should check for existing networks configuration before creating
if_params structure, or it leads to the memory leak.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-14 02:20:27 +03:00
Igor Ryzhov
5e28025a5b ospfd: remove dead code
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>
2020-10-14 00:02:48 +03:00
Igor Ryzhov
9466ef38cc ospfd: don't remove interface config when removing router
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 23:11:10 +03:00
Igor Ryzhov
bf617538be ospfd: fix missing initialization and check for if_area param
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 22:53:02 +03:00
Igor Ryzhov
2917d36bf9 ospfd: fix freeing of if_params struct
Freeing of configuration structure should not depend on operational
variable.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 22:52:12 +03:00
Igor Ryzhov
e7378cb1e9 ospfd: fix missing newline
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 22:48:56 +03:00
Jafar Al-Gharaibeh
5875867dba
Merge pull request #7295 from donaldsharp/ospf_crash
ospfd: Prevent crash if transferring config amongst instances
2020-10-13 13:27:55 -05:00
Donald Sharp
aadbfa4918
Merge pull request #7294 from idryzhov/fix-no-ip-ospf-area
ospfd: fix "no ip ospf area"
2020-10-13 13:37:03 -04:00
Donald Sharp
2b0a32da60 ospfd: Prevent crash if transferring config amongst instances
If we enter:

int eth0
  ip ospf area 0
  ip ospf 10 area 0
!

This will crash ospf.  Prevent this from happening.

OSPF instances:

a) Cannot be mixed with non-instance
b) Are their own process.

Since in multi-instance world ospf instances are their own process,
when an ospf processes receives an instance command we must remove
our config( if present ) and allow the new config to be active
in the new process.  The problem here is that if you have not
done a `router ospf` above the lookup of the ospf pointer will
fail and we will just crash.  Put some code in to prevent a crash
in this case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-13 08:16:15 -04:00
Igor Ryzhov
e4129293c7 ospfd: fix "no ip ospf area"
This commit fixes the following behavior:
```
nfware(config)# interface enp2s0
nfware(config-if)# ip ospf area 0
nfware(config-if)# no ip ospf area 0
% [ospfd]: command ignored as it targets an instance that is not running
```

We should be able to use the command without configuring the instance.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 14:52:38 +03:00