Commit Graph

242 Commits

Author SHA1 Message Date
Mobashshera Rasool
22813fdb86 ospf6d: Store ospf6 back pointer in route struct
Storing the pointer to ospf6 struct in route struct.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-21 05:20:30 +00:00
David Lamparter
621ee705b5 ospf6d: use OSPF6_INTERFACE_LOOPBACK state
The OSPF6_INTERFACE_LOOPBACK interface state wasn't entered anywhere,
even if the interface was OSPF6_IFTYPE_LOOPBACK.  Fix.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-07-20 11:22:21 +02:00
Donald Sharp
802a83935f
Merge pull request #9037 from idryzhov/ospf6-freebsd
ospf6d: fix freebsd mcast group issues
2021-07-13 09:40:13 -04:00
Igor Ryzhov
93828a9923 ospf6d: fix freebsd mcast group issues
There's a delay in FreeBSD between issuing a command to leave a
multicast group and an actual leave. If we execute "no router ospf6" and
"router ospf6" fast enough, we can end up in a situation when OS
performs the leave later than it performs the join and the interface
remains without a multicast group.

Instead of counting on a one second delay, we must wait until the
interface actually leaves the group.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-12 22:56:04 +03:00
Donald Sharp
482467dc6a ospf6d: Correct spelling in debug
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-12 07:24:16 -04: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
Abhinay Ramesh
4069972831 ospf6d: Show neighbor displays twice for every neighbor.
Problem Statement:
=================
When show ipv6 ospf6 neighbor is executed each neighbor gets
displayed twice.

frr# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
1.1.1.1           1    00:00:39     Full/DR              00:00:10 ens192[BDR]
1.1.1.1           1    00:00:39     Full/DR              00:00:10 ens192[BDR]

RCA:
====
Since ospf6_interface gets added twice to if_list we see multiple
display output.

Fix:
====
add ospf6_interface to if_list only when newly area gets attached
to the interface. If its already added no need to add it again.

Risk:
=====
Low

Tests Executed:
===============
Have tested the defect scenario.

frr# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
1.1.1.1           1    00:00:35     Full/DR              00:36:04 ens192[BDR]
frr#

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-06-23 09:24:35 +00:00
Russ White
b79f1e068e
Merge pull request #8725 from pjdruddy/ospfv3_fair_socket
OSPFv3 socket rework
2021-06-22 10:58:33 -04: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
lynne
1b1f7b4f15 ospf6d: move error logs out from behind debug flags
The logging in ospf6 is very verbose.  If you turn on logging on a scaled
system you get too many logs.   The problem is that there are some errors
that occur that are hidden behind the debug flags, and to see these errors
we currently need to turn on the debug logging.  This change converts these
error logs to warnings and removes the debug flags.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-06-14 15:46:49 -04:00
Stephen Worley
5c2b86bba9 ospf6d: fix undefined function
Some wires got crossed during a couple merges using/changing
this function.

Update it to its new name.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2021-06-10 17:39:56 -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
d16cff32b2 ospf6d: fix using vrf interface as a loopback
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-28 16:14:34 +03:00
Igor Ryzhov
b4b6bd0017 ospf6d: fix possible crashes
OSPF6 instance may not exist when processing interface state change.
Do not execute processing steps that require an instance if an area is
not configured for an interface.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-25 21:59:46 +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
Rafael Zalamena
4478793c43
Merge pull request #8636 from idryzhov/ospfv3-vrf-support
OSPFv3 VRF support
2021-05-06 08:50:32 -03: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
Yash Ranjan
17ab36c6c4 ospf6d: Send Link LSAs when interface priority is changed
As per the ospfv3 conformance test 24.3

SETUP: Configure DIface-0 with priority set to <hprty>.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0.
DUT: Exchange all the <OSPF-DD> packets, during adjacency establish- ment.
ANVL: Verify that the received <OSPF-DD> packets contain: • one header of Link-LSA, originated by DUT.
ANVL: Send <OSPF-LSR> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• One Request Tuple for Link-LSA originated by DUT.
ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0. DUT: Send <OSPF-LSU> packet.
ANVL: Verify that the received <OSPF-LSU> packet contains:
• •
one Link-LSA, originated by DUT, contains: Rtr Pri field set to <hprty>.
----------
When interface priority is changed Link LSAs should be tranmitted
with the priority set.

When the link priorty chanages, the drbdr algorithm is called, which
can change the state of the interface. But if the state does not
changes then LINK LSAs are not transmitted.

This PR fixes this issue. If the state is changed, then LINK LSAs
will anyways be tranmitted. But in case the state is not changed,
even in that case Link LSAs are tranmitted.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-05-02 10:19:16 -07:00
Rafael Zalamena
1f7be0d242 ospf6d: add support for BFD profiles
Allow user to pre configure BFD sessions using profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:04 -03:00
Rafael Zalamena
d06cc41644 ospf6d: rework BFD integration
Use the new BFD library to integrate with BFD.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:01 -03: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
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
David Lamparter
8451921b70 *: require semicolon after DEFINE_HOOK & co.
See previous commit.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
David Lamparter
bf8d3d6aca *: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...

With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.

Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
ckishimo
d100d0b00c ospf6d: remove interface prefix when area is removed
This bug was first reported in PR#7717. When removing an interface
from the area, the interface prefix is still shown

  r1# sh ipv6 ospf6 interface prefix
  *N IA 2013:12::/64       ::1      r1-r2-eth0 00:00:12

  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 ipv6 ospf6 interface prefix
  *N IA 2013:12::/64       ::1      r1-r2-eth0 00:00:22

This fix will check if the interface is disabled so the
prefix is not shown

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 00:01:22 +01:00
Emanuele Di Pascale
7bfc5ae813 ospf6d: fix setting NOAUTOCOST flag
ospf6 keeps a flag to remember whether the cost for an interface
was manually added via config or computed automatically, but if
the configured value matches the auto-computed one we were not
setting this flag, meaning that the config would not show up in
the config.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-03-03 10:56:51 +01:00
Russ White
67821bf2ad
Merge pull request #8051 from volta-networks/fix_ospf6_hello_lo
ospf6d: Don't send hellos on loopback interface
2021-02-16 11:42:01 -05:00
lynne
cb978d686b ospf6d: Don't send hellos on loopback interface
When ospf6 passive is turned off on a loopback interface don't start
sending ospf6 hellos.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-02-09 19:31:18 -05:00
Yash Ranjan
35aeb295ed ospf6d: Json support added for command "show ipv6 ospf6 interface prefix [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 interface prefix" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-01-26 20:06:02 -08: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
Donald Sharp
9ae41e3105 ospf6d: Track wait_timer and disable when needed
When removing ospfv3 from an interface that has been previously
put into wait state, there is a possible use after free of the
oi because the wait_timer could have been started for the interface.
This is because the wait_timer was not tracked by the interface
and we just created a thread for it without storing the thread
pointer.

Issue: #7932
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-26 08:13:44 -05:00
Mobashshera Rasool
bb4c56616f ospf6d: Link LSA is not updated when router priority is modified
Issue: #7727

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-12-14 07:57:13 +00: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
Donald Sharp
b84696e6c0
Merge pull request #7454 from ranjanyash54/dev_8
ospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"
2020-11-18 18:37:30 -05:00
github login name
f16ae8cf5d ospf6d: Json support added for command "show ipv6 ospf6 interface [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 interface" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-11-16 21:18:39 -08:00
github login name
ba30b37677 ospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 interface traffic" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-11-15 21:16:10 -08:00
github login name
6a5bb30062 ospf6d: Json support added for command "show ipv6 ospf6 neighbor [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 neighbor" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-11-04 22:44:21 -08:00
Rafael Zalamena
7c62dc76d4
Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6
ospf6d : Transformation changes for ospf6 vrf support.
2020-11-03 11:59:38 -03:00
harios_niral
beadc736bb ospf6d : Transformation changes for ospf6 vrf support.
1. All the changes are related to handle ospf6 with different vrf.
2. The dependancy of global ospf6 is removed.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-10-30 23:50:08 -07: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
Donald Sharp
2e37407f9d ospf6d, tests: Prevent use after free
The code pattern:

for (ALL_LSDB(lsdb, lsa)) {
	remove_lsa(lsa)
}

has a use after free in ALL_LSDB, since we ask for the next pointer,
after it has been freed.

Modify the code such that we grab the next pointer before we can
possibly free it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11 11:16:44 -04:00
Donald Sharp
c527acf1eb ospf6d: Move header includes around to reflect reality
ospf6_network.h needs ospf6_top.h to be included
first.

This makes newer versions of gcc much much happier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-08 20:44:23 -04:00
Mark Stapp
f6d11a9bf6 ospf6d: fix SA warning
Fix an SA issue in ospf6_interface.c.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-03 12:57:36 -04:00
Kaushik
c5d28568c6 ospf6d : Preparing for ospf6d VRF support.
1. Removed the VRF_DEFAULT dependency from ospf6d.
2. The dependency on show command still exist
   will be fixed when the ospf6 master is available.

Co-authored-by: Harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-09-01 03:02:46 -07:00
David Lamparter
3efd0893d0 *: un-split strings across lines
Remove mid-string line breaks, cf. workflow doc:

  .. [#tool_style_conflicts] For example, lines over 80 characters are allowed
     for text strings to make it possible to search the code for them: please
     see `Linux kernel style (breaking long lines and strings)
     <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
     and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:37:25 +02:00
David Lamparter
f4b8291fcb *: move CLI node names to cmd_node->name
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:59 +02:00
David Lamparter
243895805a *: move CLI parent data to cmd_node->parent_node
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
612c2c15d8 *: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
249a771b63 *: remove cmd_node->vtysh
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
2b64873d24 *: generously apply const
const const const your boat, merrily down the stream...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-02 15:01:29 +01:00
Russ White
9898a2fb34
Merge pull request #5009 from donaldsharp/interface_deletion
lib, zebra: Allow for interface deletion when kernel event happens
2019-09-30 07:46:19 -04:00
Donald Sharp
3c3c325203 *: Convert zapi->interface_delete to ifp callback
Convert the callback of the interface_delete to the new
ifp callback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
b0b69e59f4 *: Convert interface_down to interface down callback
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ddbf3e6060 *: Convert from ->interface_up to the interface callback
For all the places we have a zclient->interface_up convert
them to use the interface ifp_up callback instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ef7bd2a3d5 *: Switch all zclient->interface_add to interface create callback
Switch the zclient->interface_add functionality to have everyone
use the interface create callback in lib/if.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
138c5a7450 *: Add infrastructure to support zapi interface callbacks
Start the conversion to allow zapi interface callbacks to be
controlled like vrf creation/destruction/change callbacks.

This will allow us to consolidate control into the interface.c
instead of having each daemon read the stream and react accordingly.
This will hopefully reduce a bunch of cut-n-paste stuff

Create 4 new callback functions that will be controlled by
lib/if.c

create -> A upper level protocol receives an interface creation event
The ifp is brand spanking newly created in the system.
up -> A upper level protocol receives a interface up event
This means the interface is up and ready to go.
down -> A upper level protocol receives a interface down
destroy -> A upper level protocol receives a destroy event
This means to delete the pointers associated with it.

At this point this is just boilerplate setup for future commits.
There is no new functionality.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
David Lamparter
5aeb4f3c60 ospf6d: track explicit interface type config
If the interface doesn't exist in system, we'll default to broadcast and
then later not change that when the interface comes up.  Explicitly
track whether the user configured the type and properly auto-set it if
they didn't.

Fixes: #3930
Fixes: #4873
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-17 16:23:44 +02:00
David Lamparter
e597335362 ospf6d: fix mistaken if_is_* instead of oi->type
If the user configured an interface to be in a particular mode, we need
to be consistent about that.  No looking at if_is_pointopoint() or
if_is_broadcast().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-17 16:18:26 +02:00
David Lamparter
84eb735560 ospf6d: interface state needs update even w/o area
We can't skip reading interface state if there's no area yet, we'll be
missing information later when the interface is configured.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-17 16:15:32 +02:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Philippe Guibert
f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Quentin Young
9f5dc3192e *: remove casts of XMALLOC / XCALLOC
No cast necessary for void *

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Philippe Guibert
22b982dfe9 ospf6d: upon interface deletion, the area if list may be updated
there are some events where the list of interfaces per area should be
reviewed due to an interface is being removed. This fix avoids having
some memory leak.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-14 18:24:01 +01:00
Rafael Zalamena
bc482dc0ca ospf6d: fix FreeBSD IPv6 multicast group join race
Avoid a IPv6 multicast group join race by delaying the group install
before processing all event queue.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-01-26 13:55:27 -02:00
Rafael Zalamena
f80003b0e1 ospf6d: keep track of the socket set thread
When using the timer to set the socket multicast options, keep track
of the thread pointer. If we lose the thread reference we might have
situations where multicast is enabled when it should be disabled and
vice versa.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-01-23 10:25:30 -02:00
Rafael Zalamena
849576ee96 ospf6d: don't queue interface events
Apply interface event as soon as possible instead of queueing an event
for it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-01-23 10:06:49 -02:00
Renato Westphal
25ee05c938 ospf6d: fix two "show" commands
The "show ipv6 ospf6 interface [IFNAME] prefix" command shouldn't accept
the "match" keyword when a prefix is not given, otherwise ospf6d will
crash.

Fixes the following crashes:
ospf6d aborted: vtysh  -c "show ipv6 ospf6 interface eth99 prefix match"
ospf6d aborted: vtysh  -c "show ipv6 ospf6 interface prefix match"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-20 12:39:05 -03:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Donald Sharp
0ce1ca805d *: ALLOC calls cannot fail
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
paco
246879c303
ospf6d: unchecked return value (Coverity 1221437)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 13:08:37 +02:00
Quentin Young
44b301a24b ospf6d: remove ospf6_interface_if_del
Unused and contains obvious NPD

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Chirag Shah
76249532fa ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.

Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.

For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.

When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.

Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4

Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4

Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-02-14 17:37:34 -08:00
Chirag Shah
43855e3d47 ospf6d: Add protocol stats and show command
Add OSPFv3 Protocol incoming/outgoing packets
stats.

r3# show ipv6 ospf6 interface traffic

Interface       HELLO            DB-Desc         LS-Req    LS-Update     LS-Ack
                Rx/Tx            Rx/Tx            Rx/Tx    Rx/Tx         Rx/Tx
--------------------------------------------------------------------------------------------
swp1              3/4              2/2             0/2     8/6           3/2
swp2              3/4              2/2             0/1     7/3           2/0
swp3              0/4              0/0             0/0     0/0           0/0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-15 16:55:24 -08:00
Juergen Kammer
0db8196a96 ospf6d: Fix setting interface ipv6 ospf6 cost value (LSA hooks were never called)
Fixes: #1420
Signed-off-by: Juergen Kammer <j.kammer@eurodata.de>

If the ipv6 ospf6 cost on an interface is changed, no recalculation of routes happens, though the interface structure is updated with the new value. The new cost will be used later, when LSA hooks are called for any other reason.

Diagnosis:
The DEFUN for the config command sets oi->cost and calls ospf6_interface_recalculate_cost(oi) whenever there is a change in the supplied value. ospf6_interface_recalculate_cost then gets the new cost for the interface by calling ospf6_interface_get_cost(oi), which returns oi->cost if a cost is manually set (i.e. we get the value we just set). ospf6_interface_recalculate_cost only calls the LSA hooks if there is a change - which obviously never happens if we compare the new value with itself.
2017-11-09 10:49:46 -05:00
Renato Westphal
451fda4f9a *: use the FOR_ALL_INTERFACES abstraction from babeld
This improves code readability and also future-proofs our codebase
against new changes in the data structure used to store interfaces.

The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but
for now only babeld is using it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:46 -03:00
Renato Westphal
f4e14fdba7 *: use rb-trees to store interfaces instead of sorted linked-lists
This is an important optimization for users running FRR on systems with
a large number of interfaces (e.g. thousands of tunnels). Red-black
trees scale much better than sorted linked-lists and also store the
elements in an ordered way (contrary to hash tables).

This is a big patch but the interesting bits are all in lib/if.[ch].

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:02 -03:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.

I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.

Let's make the api explicit in it setting the list pointer
to null.

Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:13 -04:00
Chirag Shah
27ae9bcd9d ospf6d: OSPFv3 interface bandwidth handling
if bandwidth is not set from Zebra  use speed as
   bandwidth for ospfv3 route cost.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-09-18 15:59:38 -07:00
David Lamparter
a8b828f3c3 *: remove empty "interface XYZ" config blocks
Using the previously-added vty_frame() support, this gets rid of all the
pointless empty "interface XYZ" blocks that get added for any interface
that shows up in the system (e.g. dummys, tunnels, etc.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
Quentin Young
d23d6de866
ospf6d: add no forms for interface commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-22 16:07:30 -04:00
Quentin Young
3257307337
ospfd, ospf6d: cleanup some no commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-22 10:55:12 -04:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
22106bbf68 Merge remote-tracking branch 'frr/master' into table-hash-ospf6-lsdb-refactor
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 17:30:56 +02:00
David Lamparter
2d8270596a Merge remote-tracking branch 'frr/master' into newline-redux
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:07:30 +02:00
David Lamparter
55f70b671f *: remove VTYNL, part 4 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
26a429fe8e *: remove VTYNL, part 2 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
6b18e3b2e0 ospf6d: VNL -> VTYNL
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
Daniel Walton
f1a05de982 vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This allows frr-reload.py (or anything else that scripts via vtysh)
to know if the vtysh command worked or hit an error.
2017-07-13 19:56:08 +00:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
David Lamparter
49dd8e3758 ospf6d: use macro for LSDB walks
... to make it easier to refactor all of the iteration uses.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-11 13:48:20 +02:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00