Igor Ryzhov [Tue, 22 Jun 2021 13:12:41 +0000 (16:12 +0300)]
ospf6d: fix redistribute configuration
ospf6_asbr_redistribute_unset must not be called if the redistribution
is not yet configured, because it decrements redistribution counter and
makes it negative in this case.
Igor Ryzhov [Mon, 21 Jun 2021 15:04:46 +0000 (18:04 +0300)]
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.
ospfd: External lsa handling in opaque capabilities enable/disable
Description:
When opaque capability disabled/enabled , all the self-originated lsa will be
flushed and it will make the neighbours to renegotiate.
But here, external lsas are not being re-originated after negotiation
Fix:
Refresh/re-originate external lsas(Type-5 and Type-7) explicitly after
re-negotiation.
Yash Ranjan [Tue, 16 Mar 2021 07:45:23 +0000 (00:45 -0700)]
ospf6d: Release last dbdesc packet after router dead interval
During the database description exchange process, the slave
releases the last dbdesc packet after router_dead_interval.
This was not implemented in the code.
I have written the function ospf6_neighbor_last_dbdesc_release,
which releases the last dbdesc packet after router_dead_interval.
This change was required as per the conformance test 13.11:
In state Full reception of a Database Description packet from
the master after this interval (RouterDeadInterval) will
generate a SeqNumberMismatch neighbor event.
Associated Parameters
ICMPv6 Packet Listen Time
ICMPv6 Packet Tolerance Factor
ICMPv6 Packet Tolerance Time
OSPFV3 DUT Interface Transmit Delay
OSPF Reset Adjacencies Timeout
Test Actions
1.
2. 3.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0, with DUT as slave.
ANVL: Wait (for <RouterDeadInterval> seconds).
ANVL: Send <OSPF-DD> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• •
I-bit field not set M-bit field not set
MS-bit field set
DD sequence number same as the one last sent by ANVL.
. ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0.
5. DUT: Trigger the event SeqNumberMismatch and set the neighbor state for neighbor Rtr-0-A to ExStart.
6. DUT: Send <OSPF-DD> packet.
7. ANVL: Verify that the received <OSPF-DD> packet contains:
• I-bit field set
• M-bit field set
• MS-bit field set.
David Lamparter [Mon, 22 Mar 2021 12:45:20 +0000 (13:45 +0100)]
lib: record output argument positions in zlog
printfrr() recently acquired the capability to record start/end of
formatting outputs. Make use of this in the zlog code so logging
targets have access to this information.
(This also records how long the `[XXXXX-XXXXX][EC 9999999]` prefix was
so log targets can choose to skip over it.)
Signed-off-by: David Lamparter <equinox@diac24.net>
David Lamparter [Thu, 8 Apr 2021 10:57:58 +0000 (12:57 +0200)]
lib: de-conflict `log-filter` CLI command
`log-filter WORD` was giving me a serious headache since it also matches
`log WORD` due to the way the CLI token handling works. This meant that
a mistyped `log something` command would silently be interpreted as a
filter string, causing me serious headscratching and WTFs until I
figured what was going on.
Remove this UX pitfall so noone else falls into it. (Since the command
was never saved to config, renaming it shouldn't cause trouble.)
[Also I apparently forgot to update the docs when I transferred this
over to the new zlog bits...]
TODO for a rainy day: since we collect all the CLI commands anyway, we
should warn somewhere for "2nd level ambiguous" commands like this.
Signed-off-by: David Lamparter <equinox@diac24.net>
Igor Ryzhov [Fri, 18 Jun 2021 10:06:13 +0000 (13:06 +0300)]
lib: remove pure attribute from functions that modify memory
Almost all functions currently marked with pure attribute acquire a
route_node lock. By marking them pure we allow compiler to optimize the
code and not call them when it already knows the return value. This is
completely incorrect.
Only two of eleven functions can be marked as pure. And they still won't
be optimized because they are never called from the same function twice.
Let's remove the ext_pure macro completely to reduce the chance of
repeating this mistake in the future.
lynne [Fri, 11 Jun 2021 14:38:42 +0000 (10:38 -0400)]
ospf6: Drop LSA with bad seqnumber
In RFC 2328 seqnumber 0x80000000 is reserved and not used. If an LSA
is received with seqnumber the LSA is now dropped and a debug error log
is printed.
Don Slice [Wed, 9 Jun 2021 21:17:21 +0000 (14:17 -0700)]
tools: add mac access-list context to frr-reload.py
Problem reported that frr-reload.py didn't handle the mac access-list
command correctly, causing reloads to fail. This fix adds the
support for the command as a single line context.
Yash Ranjan [Wed, 2 Jun 2021 12:45:18 +0000 (05:45 -0700)]
ospf6d: Set metric from default values when route-map metric not present
For redistribute commands if route map is set, then route takes it's metric
values from the route map. But in the case that routemap is set but the
metric for the route map is not, then the route metric is set to type-1.
Check if the metric is set for the routemap. If not then set it as per
redistributed default values (type 2)
Yash Ranjan [Mon, 24 May 2021 10:44:12 +0000 (03:44 -0700)]
ospf6d: Change the default metric parameter for redistribute
The default values will be set at the time of ospf6_redist_add
similar to ospfv2. Hence the default values will change as well.
Default metric type = E2
Default metic value = 20
Pat Ruddy [Tue, 25 May 2021 09:39:03 +0000 (10:39 +0100)]
tests: Modify topotests to include write-multiplier config
Modify both the default and vrf ospf6 topologies to include a test
where write-multiplier is configured to a non-default value and
the ospf6 neighbors are reset then checked.
Run black on both test files.
Pat Ruddy [Wed, 3 Mar 2021 11:59:30 +0000 (11:59 +0000)]
ospf6d: read ospf6 socket until failure
To ensure we read all the datagrams availabe from a socket when the
read task is scheduled, make the read helper return and error or
continue enum and loop unitl an error is received.
This requires the read from the socket to be non blocking
Pat Ruddy [Wed, 3 Mar 2021 11:17:38 +0000 (11:17 +0000)]
ospf6d: create an ospf_read_helper function
Take the contents of ospf6_receive and split the funtionality that
deals with a single packet receipt and place it in a separate helper
function.
This is the first step in a refactor process to allow the ospf6_read
task to read until failure.
Igor Ryzhov [Thu, 17 Jun 2021 16:31:03 +0000 (19:31 +0300)]
ospfd: fix routemap update
Currently, if the routemap already exists, we delete the pointer to it
when it is updated. We should delete the pointer only if the route-map
is actually deleted.
Wesley Coakley [Wed, 9 Jun 2021 03:50:43 +0000 (23:50 -0400)]
docker: Use tini unilaterally and stop tailing /dev/null
tini is a hyper-minimal PID 0 which spawns a child process (watchfrr.sh
in our case), reaps zombies and forwards signals to the script. Starting
watchfrr.sh directly instead of through the old `tail /dev/null` or
`sleep 365d` helps keep things clean too :)
While tini was previously only used in the Alpine container it is useful
to apply this PID 0 to all containers except the special CI ones.