Commit Graph

180 Commits

Author SHA1 Message Date
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
Igor Ryzhov
36d3fcccb4
Merge pull request #8944 from opensourcerouting/ospf6-mtu-revert
ospf6d: revert PR #8622
2021-07-27 16:06:40 +03:00
Mobashshera Rasool
ad21f6c285 ospf6d: ASBR summarisation per VRF
Added code to support the ASBR summarisation per VRF.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-21 05:20:33 +00:00
Mobashshera Rasool
789828186e ospf6d: Review comment fixes
This commit is ease reviewing the review comment fixes.

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
Mobashshera Rasool
4dc4388691 ospf6d: ASBR Summarisation feature implementation
Feature Implementation.
========================
This feature will help in advertising the External LSAs with aggregation.
The commands allow us to tune the advertisement with different parameters
as mentioned in the CLI List below.
It can also help in case we do not want to advertise any prefix with the
no-advertise option.

New CLIs added:
===============
summary-address X:X::X:X/M$prefix [tag (1-4294967295)] [{metric (0-16777215) | metric-type (1-2)}]
no summary-address X:X::X:X/M$prefix [tag (1-4294967295)] [{metric (0-16777215) | metric-type (1-2)}]
summary-address X:X::X:X/M$prefix no-advertise
no summary-address X:X::X:X/M$prefix no-advertise
aggregation timer (5-1800)
no aggregation timer (5-1800)
show ipv6 ospf6 summary-address [detail$detail] [json]
debug ospf6 lsa aggregation

CAT RUN:
========
QE to add test scripts

Signed-Off-by: Mobashshera Rasool <mrassol@vmware.com>
2021-07-21 05:16:54 +00:00
Donald Sharp
30885c7099
Revert "ospf6d: fix LSAs remain in LSDB with an old router-id value" 2021-07-02 12:38:11 -04:00
Louis Scalbert
c54fb080a0 ospf6d: reset areas and redistribution at router-id modification
The ospf6 router-id is provided by order of preference by:

 ospf6d itself if the "ospf6 router-id X.X.X.X" command is set.
- zebra. If the "ip router-id X.X.X.X" zebra command is set, the
  configured IP is provided as the ID or alternatively the highest
  loopback IPv4 address or else the highest interface IPv4 address.

The running ospf6 router-id is stored in ospf6->router-id.

ospf6->router-id can change in the following conditions:

- A configuration change provides a new router-id value according to
  the above rules. ospf6->router-id is updated to the new value if
  there is no adjacency in FULL state. Otherwise, the ospf6d process
  must be restarted to take the new router-id into account.
- On startup of both zebra and ospf6d, if ospf6d has not yet received a
  valid router-id, ospf6d->router-id is set to 0 (i.e. 0.0.0.0). Then,
  zebra notifies ospf6d that the router-id is available.

At ospf6->router-id, the current behavior of ospf6d is the following:

- The self generated LSAs that refer to the previous router-id as the
  advertising router are kept.
- Self generated LSAs are created with router-id value.
- LSAs from the redistribution that refer to the previous router-id are
  kept and no new redistribution LSAs are created.

As a consequence, the routers in the ospf6 areas will get incorrect
LSAs and might not be able to install prefixes of those LSAs into their
RIB.

This fix solves this issue by resetting the areas and the redistribution
when ospf6->router-id updated.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2021-07-01 14:40:14 +02:00
Louis Scalbert
6794884231 ospf6d: factorize router-id update
ospf6_router_id_update function is used by ospf6_router_id_update_zebra
to update the running the ospf6 router-id.

This patches makes the functions to (un)configure ospf6 router-id use
the same function as ospf6_router_id_update_zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
---
2021-07-01 14:40:14 +02:00
Louis Scalbert
08965422d0 ospf6d: don't update router-id if at least one adjacency is Full
When a router-id change is notified by zebra to ospf6d, we only take
into account the change if no adjacencies are in Full state.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2021-07-01 14:40:07 +02:00
Igor Ryzhov
3c5122c5a7 ospf6d: use per-vrf router id instead of one global
This code was not fully completed when adding support for VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-29 18:10:41 +03:00
David Lamparter
0c3a104a7a Revert "ospf6d: Limit the number of interface addresses being supported"
This reverts commit f85b76195a.
2021-06-29 15:17:01 +02:00
Yash Ranjan
f71ed6df3e ospf6d: "clear ipv6 ospf6 process" command
Adding the "clear ipv6 ospf6 command" . It resets
the ospfv3 datastructures and clears the database
as well as route tables. It resets the neighborship
by restarting the interface state machine.
If the user wants to change the router-id, this
command updates the router-id to the latest static
router-id and starts the neighbor formation with
the new router-id.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-06-27 20:56:10 -07:00
Russ White
b79f1e068e
Merge pull request #8725 from pjdruddy/ospfv3_fair_socket
OSPFv3 socket rework
2021-06-22 10:58:33 -04:00
Igor Ryzhov
f5eef2d5a8 lib: remove vrf-interface config when removing the VRF
If we have the following configuration:
```
vrf red
 smth
 exit-vrf
!
interface red vrf red
 smth
```
And we delete the VRF using "no vrf red" command, we end up with:
```
interface red
 smth
```
Interface config is preserved but moved to the default VRF.

This is not an expected behavior. We should remove the interface config
when the VRF is deleted.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-21 18:04:46 +03:00
Pat Ruddy
78156066b9 ospf6d: add write-multiplier configuration
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>
2021-06-18 09:40:42 +01:00
Pat Ruddy
4f7bf1ab05 ospf6d: add tx fifo infrastructure
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>
2021-06-18 09:40:42 +01:00
Rafael Zalamena
ea67959995
Merge pull request #8823 from donaldsharp/ospfv3_coverity
Ospfv3 coverity
2021-06-10 15:13:11 -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
Donald Sharp
0d882ec7a3 ospf6d: Fix coverity Possible null deref
There exists a code path where ospf6 could be NULL and passing
to a function where it would always be derefed is a bad idea.

Put some small code in place to prevent this and allow this to be debuged
if it happens in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-10 07:46:36 -04:00
Igor Ryzhov
42cabc552d ospf6d: fix interface area configuration
Currently the interface area is configured from the router node using
"interface IFNAME area ID" command. There are multiple problems with
this command:
- it is not in line with all other interface-related commands - other
  parameters are configured from the interface node using "ipv6 ospf6"
  prefix
- it is not in line with OSPFv2 - area is configured from the interface
  node using "ip ospf area" command
- most importantly, it doesn't work correctly when the interface is in
  a different VRF - instead of configuring the interface, it creates a
  new fake interface and configuring it instead

To fix all the problems, this commit adds a new command to the interface
configuration node - "ipv6 ospf6 area ID". The purpose of the command is
completely the same, but it works correctly in a multi-VRF environment.

The old command is preserved for the backward compatibility, but the
warning is added that it is deprecated because it doesn't work correctly
with VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-08 21:38:09 +03: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
Igor Ryzhov
92699b9bbe ospf6d: unlink router from vrf on deletion
Otherwise `ospf6_lookup_by_vrf_id` returns stale pointer.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-27 14:39:28 +03:00
Igor Ryzhov
82bc4b8a96 ospf6d: fix "default-information originate" in non-existing vrf
If the default route redistribution is configured in OSPF6 router before
the VRF is created, then this is not currently registered in zebra after
the VRF creation.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:24:22 +03:00
lynne
f85b76195a ospf6d: Limit the number of interface addresses being supported
The code had no limits on addresses configured on an interface running
ospf6d.  The code would crash when more than 100 addresses were added.
This change limits the number of interface address to 100 if mtu is set
to the default value.  If the mtu is set to a jumbo packet size or larger
we will support 200 interface addresses.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-05-11 09:43:07 -04:00
harios_niral
d48ef099db ospf6d: add vty support for multiple vrfs
Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
2021-05-06 10:54:31 +03:00
harios_niral
4e8ccd9213 ospf6d: add internal support for multiple vrfs
Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
2021-05-05 23:17:01 +03:00
Russ White
43f337aee8
Merge pull request #8487 from pguibert6WIND/ospf6_vrfs
ospf6d: add 'show ipv6 ospf6 vrfs' command
2021-04-27 15:06:11 -04:00
Mobashshera Rasool
ffdc63f9b4 ospf6d: Do not delete external table when configure max-path
Issue: When maximum-path is configured in ospf6 view, the
function ospf6_restart_spf deletes the external table as well
which is not required since that stores the redistribute routes.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-04-19 05:28:24 +00:00
Yash Ranjan
f85a41124b ospf6d: Fix coredump when "no interface IFNAME area <A.B.C.D>" is called
When oi->area == NULL, it tries to print the
interface's area name, but no area is present.
Print the area name from the command argument instead.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-04-18 04:22:56 -07:00
Philippe Guibert
dd7fb1db6c ospf6d: add 'show ipv6 ospf6 vrfs' command
this command summarises the ospf6 instances along with the router-id and
the vrf_id associated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-16 16:21:13 +02:00
Yash Ranjan
b8212e0310 ospf6d: Add logic to change the status of router to ASBR
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-03-29 06:37:10 -07:00
Yash Ranjan
b19502d3b0 ospf6d: Add CLI and logic for default-information originate command
Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-03-29 06:37:10 -07:00
David Lamparter
30043e4ce2 ospf6d: kill ospf6_memory.h, use MTYPE_STATIC
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>
2021-03-22 19:31:56 +01:00
Donatas Abraitis
37916b2b11
Merge pull request #8121 from opensourcerouting/macro-cleanup
*: require ISO C11 + semicolons after file-scope macros
2021-03-22 11:00:34 +02:00
David Lamparter
67b0f40c98 *: require semicolon after FRR_CFG_DEFAULT_*
... again ...

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter
96244aca23 *: require semicolon after DEFINE_QOBJ & co.
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:37 +01:00
ckishimo
800cc91882 ospf6d: fix warning message when interfae disabled
When removing an interface from an existing area,
the warning message we get is not correct

  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
  !
  interface dummy
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
   ipv6 ospf6 network point-to-point
  !
  router ospf6
   ospf6 router-id 1.1.1.1
   interface r1-r2-eth0 area 0.0.0.0
  !

  r1(config-if)# router ospf6
  r1(config-ospf6)# no interface dummy area 0.0.0.0
  No such Area-ID: 0.0.0.0   <--- area 0.0.0.0 exists

This is fixing the error message

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 00:14:32 +01:00
ckishimo
5ac69ec52a ospf6d: fix iface commands lost when removing from area
In OSPFv3 when removing the interface from an area, all ospf6
interface commands are lost, so when changing the area you need
to reconfigure all ospf6 interface commands again

  r1# sh run
  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
   ipv6 ospf6 network point-to-point
  !
  router ospf6
   ospf6 router-id 1.1.1.1
   interface r1-r2-eth0 area 0.0.0.0
  !

  r1# conf t
  r1(config)# router ospf6
  r1(config-ospf6)# no interface r1-r2-eth0 area 0.0.0.0
  r1(config-ospf6)# exit

  r1# sh run
  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
  !                            <----- missing all ipv6 ospf6 commands
  router ospf6
   ospf6 router-id 1.1.1.1
  !

This is because the interface is being deleted instead of disabled
(see PR#7717) I believe the interface should be left as disabled
(not deleted) when removing the interface from the area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-16 23:47:23 +01:00
Mark Stapp
4a9178f2f4
Merge pull request #7961 from mobash-rasool/ospfv3-feature
ospf6d: add CLI to control maximum paths for routes.
2021-02-04 13:32:34 -05:00
Donald Sharp
d512cb376a
Merge pull request #7402 from ranjanyash54/dev_2
ospf6d: Json support added for command "show ipv6 ospf6 route [json]"
2021-02-01 21:07:57 -05:00
Mobashshera Rasool
1958143e30 ospf6d: add CLI to control maximum paths for routes.
CLI added:
maximum-paths (1-64)

Issue: #7961

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-02-01 09:05:52 +00:00
Donald Sharp
8b36526475 ospf6d: Remove #if 0 code that has not been used in a long time
The earliest that some of this code is 2018.  There is not
much point in keeping this code around.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-28 13:34:55 -05:00
Yash Ranjan
eacd0828d4 ospf6d: Json support added for command "show ipv6 ospf6 route [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 route [<intra-area|inter-area|external-1|
external-2|X:X::X:X|X:X::X:X/M|detail|summary>]"
with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-01-26 20:06:02 -08:00
Yash Ranjan
4a30f0568f ospf6d: ospfv3 disable on the interface, but interface prefix still shown in the output
When the ospfv3 interface is disabled by the command "no interface <eth> area <area-id>
the linked interface prefixes does not get flushed

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-12-13 05:50:57 -08:00
Rafael Zalamena
551e30a5ff
Merge pull request #7492 from Niral-Networks/niral_ospfv3_fix_redist
ospf6d : Code refactoring for route redistribution.
2020-12-10 09:01:12 -03:00
Kaushik
a069482f1f ospf6d : Code refactoring for route redistribution.
1. Created new ospf6_redist structure.
2. Moved the 'route_map' structure from structure 'ospf6' to
   structure 'ospf6_redist'.
3. Added new message type OSPF6_REDISTRIBUTE.
4. Added the placeholder for metric option in structure ospf6_redist
   for redistribute.
5. Added few API's for route redistribute lookup, add & del.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-12-09 13:27:23 +05:30
Igor Ryzhov
d313699058 ospf6: move serv_close to ospf6_delete
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-30 17:36:10 +03:00
Igor Ryzhov
f5f26b8fca ospf6: get instance from lsdb data
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-30 17:36:10 +03:00
Igor Ryzhov
e285b70d3c ospf6: get instance from route table scope
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-30 17:36:10 +03:00