Commit Graph

221 Commits

Author SHA1 Message Date
Donald Sharp
c905f04c7c ospf6d: Clean up thread interface
a) Remove setting of thread pointer to NULL after
thread invocation, this is already done.

b) Use thread_is_scheduled()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 09:52:16 -04:00
Donald Sharp
23b11ab185 ospf6d: Remove double check of default prefix
The ospf6_is_valid_summary_addr function is checking
to see if a prefix is the default and also then double
comparing it against the v6 prefix part.  No need to do this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 09:52:16 -04:00
Donatas Abraitis
6006b807b1 *: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11 14:08:47 +03:00
Donatas Abraitis
8998807f69 *: Avoid casting to the same type as on the left
Just not necessary.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-08 16:07:42 +03:00
Donald Sharp
7baebfb715
Merge pull request #10447 from ton31337/fix/json_with_whitespaces
*: Fix JSON keys with whitespaces and PascalCase
2022-03-13 18:19:33 -04:00
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
Donald Sharp
bbf5104c5b ospf6d: Fix spelling mistakes
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:52:05 -05:00
Abhinay Ramesh
6cb85350df ospf6d: Stitching the auth trailer code with rest of ospf6.
Problem Statement:
==================
RFC 7166 support for OSPF6 in FRR code.

RCA:
====
This feature is newly supported in FRR

Fix:
====
Core functionality implemented in previous commit is
stitched with rest of ospf6 code as part of this commit.

Risk:
=====
Low risk

Tests Executed:
===============
Have executed the combination of commands.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2022-02-09 01:57:08 +00:00
Donatas Abraitis
08d79bce3d ospfd,ospf6d: Add JSON additional keys with no whitespaces inside
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-03 10:48:06 +02:00
Igor Ryzhov
0624c3cfcc
Merge pull request #10373 from anlancs/ospf-add-asbr
ospfd: fix missing "aggregation timer" in running configuration
2022-02-01 19:04:33 +03:00
Igor Ryzhov
8ccce75009
Merge pull request #10435 from ckishimo/ospf6d_distance
ospf6d: fix distance not applied
2022-02-01 13:28:44 +03:00
anlan_cs
74e8311eb3 ospf6d: adjust type of "aggr_delay_interval"
Adjust type of "aggr_delay_interval":
Just replace `unsigned int` with `uint16_t` for range is (50..1800).

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28 20:11:30 -05:00
ckishimo
94c78d3b6d ospf6d: print administrative distance in show ipv6 ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-28 14:20:14 +01:00
ckishimo
fcd45026a2 ospf6d: restart spf when distance is updated
if r1 has a route received from a neighbor and the same route
configured as static, the administrative distance will determine
which route to use

r1(config)# ipv6 route 1:1::1/128 Null0 70

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

S>* 1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:12
O   1:1::1/128 [110/20] via fe80::1833:c9ff:fe7b:3e43, r1-r2-eth0, weight 1, 00:00:49

The static route is selected. If we now change the administrative distance
in ospf6, the OSPF route should be selected

r1(config)# router ospf6
r1(config-ospf6)# distance 50

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

S>* 1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:39
O   1:1::1/128 [110/20] via fe80::1833:c9ff:fe7b:3e43, r1-r2-eth0, weight 1, 00:01:16

However the distance is not applied as there are no changes in the routing table

This commit will force the update of the routing table with the new configured distance

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

O>* 1:1::1/128 [50/20] via fe80::8cb7:e6ff:fef5:2344, r1-r2-eth0, weight 1, 00:00:03
S   1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:19

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-28 14:18:54 +01:00
Igor Ryzhov
870791a3b5 *: do not send opaque data to zebra by default
Opaque data takes up a lot of memory when there are a lot of routes on
the box. Given that this is just a cosmetic info, I propose to disable
it by default to not shock people who start using FRR for the first time
or upgrades from an old version.

Fixes #10101.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 22:18:46 +03:00
Russ White
05786ac774
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs
OSPF opaque route attributes
2022-01-18 09:08:38 -05:00
Rafael Zalamena
4e4c027803
Merge pull request #10183 from idryzhov/rework-vrf-rename
*: rework renaming the default VRF
2022-01-17 08:45:12 -03:00
Renato Westphal
5b5d66c431 lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Update ospfd and ospf6d to send opaque route attributes to
zebra. Those attributes are stored in the RIB and can be viewed
using the "show ip[v6] route" commands (other than that, they are
completely ignored by zebra).

Example:
```
debian# show ip route 192.168.1.0/24
Routing entry for 192.168.1.0/24
  Known via "ospf", distance 110, metric 20, best
  Last update 01:57:08 ago
  * 10.0.1.2, via eth-rt2, weight 1
    OSPF path type        : External-2
    OSPF tag              : 0

debian#
debian# show ip route 192.168.1.0/24 json
{
  "192.168.1.0\/24":[
    {
      "prefix":"192.168.1.0\/24",
      "prefixLen":24,
      "protocol":"ospf",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      [snip]
      "ospfPathType":"External-2",
      "ospfTag":"0"
    }
  ]
}
```

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-15 17:22:27 +01:00
anlan_cs
d6b901ac78 ospf6d: give error information for commands with non-exist vrfs
Currently the ospf6d's commands with non-exist vrfs can't give the error
informations to users.

This commit adds a macro "OSPF6_CMD_CHECK_VRF" to give error information
if with non-exist vrfs. As usual, skip the checking process in the case
of json.

So one command can call this macro to do the checking process in its
end. At that time it need know json style or not, so add "json" parameter for
several related functions.

BTW, suppress the build warning of the macro `OSPF6_FIND_VRF_ARGS`:
"Macros starting with if should be enclosed by a do - while loop to avoid
possible if/else logic defects."

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-11 04:21:05 -05:00
Igor Ryzhov
ac2cb9bf94 *: rework renaming the default VRF
Currently, it is possible to rename the default VRF either by passing
`-o` option to zebra or by creating a file in `/var/run/netns` and
binding it to `/proc/self/ns/net`.

In both cases, only zebra knows about the rename and other daemons learn
about it only after they connect to zebra. This is a problem, because
daemons may read their config before they connect to zebra. To handle
this rename after the config is read, we have some special code in every
single daemon, which is not very bad but not desirable in my opinion.
But things are getting worse when we need to handle this in northbound
layer as we have to manually rewrite the config nodes. This approach is
already hacky, but still works as every daemon handles its own NB
structures. But it is completely incompatible with the central
management daemon architecture we are aiming for, as mgmtd doesn't even
have a connection with zebra to learn from it. And it shouldn't have it,
because operational state changes should never affect configuration.

To solve the problem and simplify the code, I propose to expand the `-o`
option to all daemons. By using the startup option, we let daemons know
about the rename before they read their configs so we don't need any
special code to deal with it. There's an easy way to pass the option to
all daemons by using `frr_global_options` variable.

Unfortunately, the second way of renaming by creating a file in
`/var/run/netns` is incompatible with the new mgmtd architecture.
Theoretically, we could force daemons to read their configs only after
they connect to zebra, but it means adding even more code to handle a
very specific use-case. And anyway this won't work for mgmtd as it
doesn't have a connection with zebra. So I had to remove this option.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-21 22:09:29 +03:00
Donatas Abraitis
c48349e346 *: Remove redundand braces for single statement blocks
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-27 11:20:59 +02:00
Donatas Abraitis
5a6c232bf8 ospf6d: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:50:37 +02:00
Donald Sharp
62fcbf073e ospf6d: Remove ospf6->external_id_table
The external_id_table was only ever used to store pointers to data
and was never used for lookup during the course of normal operations.
However it did lead to crashes because somewhere along the way
external routes stored in the external_table never had their
id associated into the external_id_table and we would assert
on the node lookup failing.

Since this code was never used for anything other than
storing data and it was never retrieved for anything useful
let's just remove it from ospf6d.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-23 19:49:28 -05:00
Igor Ryzhov
3c52293809
Merge pull request #10092 from ton31337/feature/replace_json_object_string_add_to_json_object_string_addf_for_inet_ntop
*: inet_ntop for JSON output
2021-11-18 22:19:40 +03:00
Donatas Abraitis
ce4b236f61 ospf6d: Replace inet_ntop to %pI4/6 for JSON outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18 18:45:41 +02:00
Donald Sharp
a8f692edb0 ospf6d: Prevent use after free
I encountered a crash where the ospf6_write thread
was already thought to be scheduled by ospf6d:

(gdb) bt
    t_ptr=0x5624ee6bd260) at lib/thread.c:972
(gdb)

When poking around it was noticed that the ospf6 pointer was crap:
(gdb) p (struct ospf6 *)$7
$8 = (struct ospf6 *) 0x5624ee6c6b20
(gdb) p *$8
$9 = {vrf_id = 3998487040, name = 0x5624ee420010 "\a", router_id = 65892, router_id_static = 65892, router_id_zebra = 0, starttime = {tv_sec = 1654674, tv_usec = 678673},
  area_list = 0x0, backbone = 0x5624ee6c6710, lsdb = 0x5624ee6c2370, lsdb_self = 0x5624ee6c5d80, route_table = 0x5624ee6c5c10, brouter_table = 0x5624ee6c4690,
  external_table = 0x5624ee6c4710, external_id_table = 0x5624ee6c4f10, external_id = 24, redist = {0x0 <repeats 32 times>}, nssa_default_import_check = {refcnt = 0,
    status = false}, flag = 1 '\001', redistribute = 0, config_flags = 0 '\000', default_originate = 0, lsa_minarrival = 1000, spf_delay = 0, spf_holdtime = 50,
  spf_max_holdtime = 5000, spf_hold_multiplier = 1, spf_reason = 554, ts_spf = {tv_sec = 1654712, tv_usec = 122041}, ts_spf_duration = {tv_sec = 0, tv_usec = 48},
  last_spf_reason = 11, fd = -1, t_spf_calc = 0x0, t_ase_calc = 0x0, maxage_remover = 0x0, t_distribute_update = 0x0, t_ospf6_receive = 0x0, t_external_aggr = 0x0,
  t_write = 0x5624ee6cc930, write_oi_count = 20, ref_bandwidth = 100000, distance_all = 0 '\000', distance_intra = 0 '\000', distance_inter = 0 '\000',
  distance_external = 0 '\000', distance_table = 0x5624ee6c4f50, inst_shutdown = 1 '\001', max_multipath = 128, gr_info = {restart_support = false, restart_in_progress = false,
    prepare_in_progress = false, finishing_restart = false, grace_period = 0, t_grace_period = 0x0}, ospf6_helper_cfg = {supported_grace_time = 1800, is_helper_supported = false,
    strict_lsa_check = true, only_planned_restart = false, enable_rtr_list = 0x0, active_restarter_cnt = 0, last_exit_reason = 0}, anyNSSA = 0 '\000', t_abr_task = 0x0,
  oi_write_q = 0x0, redist_count = 0, aggr_action = 1, aggr_delay_interval = 6, rt_aggr_tbl = 0x5624ee6c51b0, qobj_node = {nid = 6163304287853836241, nodehash = {hi = {next = 0x0,
        hashval = 1613461457}}, type = 0x5624ed65e4e0 <qobj_t_ospf6>}}

Upon code inspection there was no place where we disabled the t_write thread upon ospf6 deletion.
If the code were to issue a `no router ospf6` and then recreate it.  We could see this crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17 18:46:06 -05:00
Igor Ryzhov
f60a11883c lib: allow to create interfaces in non-existing VRFs
It allows FRR to read the interface config even when the necessary VRFs
are not yet created and interfaces are in "wrong" VRFs. Currently, such
config is rejected.

For VRF-lite backend, we don't care at all about the VRF of the inactive
interface. When the interface is created in the OS and becomes active,
we always use its actual VRF instead of the configured one. So there's
no need to reject the config.

For netns backend, we may have multiple interfaces with the same name in
different VRFs. So we care about the VRF of inactive interfaces. And we
must allow to preconfigure the interface in a VRF even before it is
moved to the corresponding netns. From now on, we allow to create
multiple configs for the same interface name in different VRFs and
the necessary config is applied once the OS interface is moved to the
corresponding netns.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-19 15:29:51 +03:00
Donatas Abraitis
d573b8f863 ospf6d: Do not explicitly set the thread pointer to NULL
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>
2021-10-08 08:56:42 +03:00
Donald Sharp
e2874251ed ospf6d: Log messages cannot have newlines
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-26 19:16:10 -04:00
Igor Ryzhov
d5cd3fd1e0
Merge pull request #9084 from louis-oui/fix-ospf6-router-id
ospf6d: fix LSAs remain in LSDB with an old router-id value
2021-09-23 19:03:35 +03:00
Louis Scalbert
078f609212 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-09-23 10:04:36 +02:00
Louis Scalbert
a30494760f 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-09-21 19:00:38 +02:00
Louis Scalbert
436a55a1d5 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-09-21 19:00:38 +02:00
Renato Westphal
7116509803 ospf6d: introduce support for Graceful Restart (restarting mode)
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>
2021-09-16 12:26:48 -03:00
Igor Ryzhov
175c92e67e ospf6d: cleanup useless checks
om6->ospf6 is always initialized at the start of the execution.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-15 19:21:47 +03:00
David Lamparter
8268be3d16
Merge pull request #9496 from idryzhov/vrf-cmd-init-unused-arg
lib: remove unused argument from vrf_cmd_init
2021-08-27 10:39:45 +02:00
Igor Ryzhov
cfc369c43a lib: remove unused argument from vrf_cmd_init
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-26 12:01:22 +03:00
Igor Ryzhov
07679ad98a *: explicitly print "exit" at the end of every node config
There is a possibility that the same line can be matched as a command in
some node and its parent node. In this case, when reading the config,
this line is always executed as a command of the child node.

For example, with the following config:
```
router ospf
 network 193.168.0.0/16 area 0
!
mpls ldp
 discovery hello interval 111
!
```
Line `mpls ldp` is processed as command `mpls ldp-sync` inside the
`router ospf` node. This leads to a complete loss of `mpls ldp` node
configuration.

To eliminate this issue and all possible similar issues, let's print an
explicit "exit" at the end of every node config.

This commit also changes indentation for a couple of existing exit
commands so that all existing commands are on the same level as their
corresponding node-entering commands.

Fixes #9206.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 22:08:20 +03:00
rgirada
0fc3e11323 ospf6d: GR helper configurations
Description:
	Adding the following cli commands to enable/disable GR helper
	functionality.
	1. [no] graceful-restart helper-only [A.B.C.D]
	2. [no] graceful-restart helper lsa-check-disable
	3. [no] graceful-restart helper planned-only
	4. [no] graceful-restart helper supported-grace-time (10-1800)

	show commands:
	show ipv6 ospf6 graceful-restart helper [detail] [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-11 23:06:49 -07:00
rgirada
0d1753a7db ospf6d: Helper functionality changes
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>
2021-08-10 02:57:23 -07:00
rgirada
59790f521a ospf6d: Init/De-init gr helper functionality
Description:
	Graceful restart helper functionality initialisation and deinit apis.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10 02:57:23 -07:00
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