Commit Graph

1561 Commits

Author SHA1 Message Date
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
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
Patrick Ruddy
d2a516dc7a
Merge pull request #7279 from donaldsharp/17_coverity
17 coverity
2020-10-13 11:48:37 +01:00
Russ White
7fabf208b0
Merge pull request #6811 from rgirada/test_helper
ospfd: ospfv2 graceful restart helper support.
2020-10-12 10:16:27 -04:00
Donald Sharp
28ef0ee121 *: Use proper semantics for turning off thread
We have this pattern in the code base:

if (thread)
	THREAD_OFF(thread);

If we look at THREAD_OFF we check to see if thread
is non-null too.  So we have a double check.
This is unnecessary.  Convert to just using THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-12 08:35:18 -04:00
Donald Sharp
8ced966f39 ospfd: When failing to set socket options just note the failure
Instead of closing the socket, just note the failure and
continue on.  If we actually failed here so many other
things would not be working at all, that actually
closing the fd won't matter.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-11 12:56:02 -04:00
ckishimo
96fad84aa0 ospfd: fix typos
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-10-07 01:53:13 -07:00
Donald Sharp
7302f333e5
Merge pull request #7228 from idryzhov/vtysh-dynamic-daemons
vtysh: dynamically generate the list of daemons for commands
2020-10-02 18:07:31 -04:00
Igor Ryzhov
31011d9cbe isisd, ospfd: fix missing/excessive docstrings
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 18:51:12 +03:00
Igor Ryzhov
d7b86ae4fe vtysh: dynamically generate the list of daemons for commands
Some daemons were actually missing from the static definitions: nhrpd,
babeld, eigrpd and bfdd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:27 +03:00
ckishimo
ab1464ddb0 ospfd: flush type 5 when type 7 is removed
When the ASBR stops announcing a prefix into the NSSA area, the LSA
type 7 is removed from the area. However the ABR is refreshing the
type 5 in its LSDB while removing the Type 7 LSA. Routers outside
the area do not get an update.

With the following topology: r1---r2---r3, with r3 being the ASBR
announcing type 7 LSA:

r3 configuration
router ospf
 redistribute static
 network 10.0.23.0/24 area 1
 area 1 nssa
!

We stop announcing prefix 3.3.3.3 in the ASBR
r3# conf
r3(config)# router ospf
r3(config-router)# no redistribute static
r3(config-router)#

r2 (ABR)
r2# sh ip os database

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33     3600 0x8000002f 0x13be E2 3.3.3.3/32 [0x0]  <-- flushed

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2          7 0x8000002f 0x73c7 E2 3.3.3.3/32 [0x0]  <-- refreshed(?)

With PR#7086 the LSA type 5 is flushed from the LSDB in r2 and the change is
announced to routers outside the area (r1)

r2# sh ip os da

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33     3600 0x80000002 0x6d91 E2 3.3.3.3/32 [0x0]  <-- flushed

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2       3600 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0]  <-- flushed

r1# sh ip os da

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2       3600 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0]  <-- flushed

Unfortunately I just realized that with PR#7086 I'm introducing a new bug, as Type-5 LSA
are not being refreshed when reaching MaxAge

r2# sh ip os da

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33       35 0x80000002 0x6d91 E2 3.3.3.3/32 [0x0]  <--- refreshed

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2       3600 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0]  <--- not refreshed!

So this PR should fix the original issue and the bug introduced later, so when stopping
redistribution in the ASBR, both type 5 and type 7 are flushed:

r2# sh ip os da

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33     3600 0x80000002 0x6d91 E2 3.3.3.3/32 [0x0]

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2       3600 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0]

Routers outside the area are also notified

r1# sh ip os da

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2       3600 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0]

Re-enabling redistribution, both LSA will be advertised again

r3# conf
r3(config)# router ospf
r3(config-router)# no redistribute static
r3(config-router)# redistribute static
r3(config-router)#

r2# sh ip os da

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33       19 0x80000001 0x6f90 E2 3.3.3.3/32 [0x0]

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2         11 0x80000001 0xcf99 E2 3.3.3.3/32 [0x0]

and they are refreshed when reaching MaxAge

                NSSA-external Link States (Area 0.0.0.1 [NSSA])

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         33.33.33.33       10 0x80000002 0x6d91 E2 3.3.3.3/32 [0x0] <-- Seq 2

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
3.3.3.3         10.0.25.2          2 0x80000002 0xcd9a E2 3.3.3.3/32 [0x0] <-- Seq 2

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-09-29 13:58:49 -07:00
Donald Sharp
e2dcd0c2c5
Merge pull request #7132 from volta-networks/fix_ldp_sync_cmds
Fix ldp sync cmds
2020-09-22 14:20:21 -04:00
Russ White
b4b7ca8944
Merge pull request #7122 from ckishimo/type4
ospfd: do not generate type 4 LSA from NSSA ABR
2020-09-22 11:30:06 -04:00
rgirada
caa1cd9eab ospfd: Debug support to ospf GR helper functionality
Description:
	Added the following debug commands to enable debugs
	GR helper functionality.
	[no] debug ospf gr helper

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 03:07:31 -07:00
rgirada
abd5b8c72c ospfd: GR helper specific show commands
Description:
	The following  show commands are added to display helper specific
	information.
	1.show ip ospf graceful-restart helper [detail] [json]
		--> displays user configurations and list of all helpers details.

	2.show ip ospf neighbour detail
		--> diplays helper details

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
rgirada
07b33add1d ospfd: GR helper config commands
Description:
	The following commands are added for helper support.
	1.[no] graceful-restart helper-only
	2.[no] graceful-restart helper-only <A.B.C.D>
	3.[no] graceful-restart helper lsa-check-disable
	4.[no] graceful-restart helper supported-grace-time
	5.[no] graceful-restart helper planned-only

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
rgirada
df074ec33a ospfd: GR helper exit scenarios
Description:
	The follwoing helper exit scenarios are handled.
	1. Recv Max age grace LSA from RESTARTER.
	2. Grace timer expiry.
	3. Due to topo change if lsa check is enabled.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
rgirada
5a77dd8feb ospfd: GR Helper functionality changes
Description:
	1. Skipping inactivity timer during  graceful restart to make
	   the RESTARTER active even after dead timer expiry.
	2. Handling HELPER on unplanned outages.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
rgirada
ad68699217 ospfd: Grace LSA processing
Description:
	1. Grace LSA processing.
	2. Validations to become a Helper. rfc3623 section 3.1

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
rgirada
06bc3110d3 ospfd: ospf GR helper initialization
Description:
	1. Graceful restart helper init/de-init.
	2. Defining dedicated memory for helper.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:33 -07:00
rgirada
f96f271366 ospfd: ospf GR helper data structure definitions.
Description:
	Graceful restart helper support specific data structure
	changes.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-21 23:59:59 -07:00
lynne
9919bec70a ospfd: updates to the ldp-sync ospf commands
Improve the output of the show ip ospf mpls ldp-sync command.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-09-21 12:07:13 -04:00
Donald Sharp
68f383438d
Merge pull request #7133 from Niral-Networks/niral_fix_ospf_timer
ospfd : Fix for ospf dead interval and hello due.
2020-09-19 08:18:46 -04:00
Kaushik
182d6bdc16 ospfd : Fix for ospf dead interval and hello due.
1. Ospf dead-interval will be set as 4 times of hello-interval, incase
if it is not set by using "ip ospf dead-interval <dead-val>".
2. On resetting hello-interval using "no ip ospf hello-interval" the
dead interval and hello due will be changed accordingly.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-09-19 00:29:25 -07:00
Donald Sharp
cb4e6e4665
Merge pull request #7074 from Niral-Networks/acl_fix
ospfd : Resolving conflict in distribute-list update during MaxAge LSA.
2020-09-18 20:46:37 -04:00
Donald Sharp
27baa2c056
Merge pull request #7086 from ckishimo/flush_type5
ospfd: flush type 5 when type 7 is removed
2020-09-18 14:58:14 -04:00
ckishimo
8273ee4448 ospfd: do not generate type 4 LSA from NSSA ABR
In a topology like R1 -- R2 -- R5, with R2 being NSSA ABR and R5 being
ASBR redistributing external routes, the ABR R2 will translate type-7
LSA into type-5 and advertise to the backbone. In the current implementation
R2 is also advertising a type-4 LSA when there is no need.

RFC 3101: "...NSSA's border routers never originate Type-4 summary-LSAs
for the NSSA's AS boundary routers, since Type-7 AS-external-LSAs are
never flooded beyond the NSSA's border..."

With this PR a type-4 LSA will not be advertised

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-09-17 07:44:14 -07:00
ckishimo
919714bd3f ospfd: fix debug ospf nssa prints wrong info
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-09-15 17:38:33 +02:00
ckishimo
a5f7319294 ospfd: flush type 5 when type 7 is removed
When the ASBR stops announcing a prefix into the NSSA area, the LSA
type 7 is removed from the area. However the ABR is refreshing the
type 5 in its LSDB while removing the Type 7 LSA. Routers outside
the area do not get an update.

With this change the LSA type 5 is flushed from the LSDB and the
change is announced to routers outside the area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-09-12 11:42:24 -07:00
Kaushik
e6baea10a4 ospfd : Resolving conflict in distribute-list update during MaxAge LSA.
1. Fix for duplicating calls of ospf_external_lsa_refresh()
   in ospf_distribute_list_update_timer().
2. Added the comment and change from PR 6981.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-09-12 06:24:30 -07:00
Renato Westphal
beb91114ec
Merge pull request #6789 from volta-networks/feat_ldp_igp_sync
ldpd: Add support for LDP-IGP Synchronization
2020-09-11 15:55:04 -03:00