Commit graph

65 commits

Author SHA1 Message Date
Mark Stapp 5be982966c ospf6: clean up -Wshadow warnings
Clean up various "shadow" warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Donald Sharp 6540f0878d ospf6d: Remove unguarded debugs in ospf6_snmp.c
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-24 10:44:15 -04:00
Andrew Cooks 0dd99a6733 ospf6d: replace OSPF6_LSA_SIZE with ospf6_lsa_size
Dropping the macro enables better compiler type checking.

The macro was not used consistently when reading the lsa size from the
header, so this change also aims to use the replacement inline function
consistently.

Keeping the inline function has (marginal) utility in that it ensures that
the endian conversion is consistently performed.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-05-28 14:07:14 +10:00
Donald Sharp 8e3a96e846
Merge pull request #14546 from adrianomarto/ospf6-point-to-multipoint
OSPF6 point to multipoint
2023-10-31 18:20:04 -04:00
Igor Ryzhov 7d67b9ff28 build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-10-12 21:23:18 +03:00
David Lamparter 5c0eed0c85 ospf6d: add point-to-multipoint interface mode
This adds the PtMP interface type, which is effectively identical to PtP
except that all the database flooding & updates are unicast.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-10-10 08:08:20 +10:00
Donald Sharp cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Igor Ryzhov 096f7609f9 *: cleanup ifp->vrf_id
Since f60a1188 we store a pointer to the VRF in the interface structure.
There's no need anymore to store a separate vrf_id field.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-22 20:47:23 +03:00
Manoj Naragund 46e9628d01 ospf6d: remove unnecessary break.
Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2021-10-26 00:57:09 -07: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
David Lamparter 09781197b6 build: make builddir include path consistent
... by referencing all autogenerated headers relative to the root
directory.  (90% of the changes here is `version.h`.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21 15:42:33 +02:00
David Lamparter 80413c2073 *: require semicolon after FRR_DAEMON_INFO & co.
... again ...

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
Donald Sharp 680b8ceb9e ospf6d: More lists being leaked
Apparently the person who wrote this code was big into
cut-n-paste.  Commit 710a61d57c
found the first instance, but upon code inspection this morning
it became evident that 2 other functions had the exact same
problem.

Fix.  Note I have not cleaned up the cut-n-paste code for
two reasons: a) I'm chasing something else b) this code
has been fairly un-maintained for a very long time.  No
need to start up now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-19 08:04:51 -05:00
Donald Sharp 710a61d57c ospf6d: Free up list memory
OSPFv3 snmp code creates a list but never deletes the actual
list.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-18 11:42:50 -05: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
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
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
Donatas Abraitis 0d6f7fd6fd *: Replace sizeof something to sizeof(something)
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-08 21:44:53 +02:00
Donatas Abraitis 752022670a *: Remove break after return
Just a deadcode.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-13 15:39:54 +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
Quentin Young 97b5d752d7 *: use array_size instead of raw division
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:16 +00: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
Donald Sharp a35bb96dee ospf6d: Don't assign to values that are never read
offset and offsetlen are never used without reassigning
in the code.  So comment out the assignments and
in case we want to start using the code for snmp
changes in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14 10:43:53 -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
Donald Sharp a6ba931e0b ospf6d: Add missing vrf lookup
The vrf lookup was missed in this conversion?

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10 09:05:02 -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
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
Donald Sharp e553b498f1 Merge pull request #820 from opensourcerouting/gcc7
fix new warnings emitted by GCC 7
2017-07-14 12:54:40 -04:00
David Lamparter acd738fc7f *: fix GCC 7 switch/case fallthrough warnings
Need a comment on these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 16:59:43 +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
David Lamparter 896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
David Lamparter 5986b66b82 *: snmp: convert into modules
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25 08:52:36 +01:00
David Lamparter 3012671ffa *: use hooks for sending SNMP traps
This means there are no ties into the SNMP code anymore other than the
init call at startup.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25 08:52:36 +01:00
David Lamparter bb4ac22a1f ospf6d: fix fallout from ifindex_t change
Only one of these variables is in fact an interface index...
(this fixes -Werror build.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-09-23 12:12:16 -04:00
Paul Jakma b892f1ddfe *: use an ifindex_t type, defined in lib/if.h, for ifindex values
(cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
2016-08-18 07:35:38 -04:00
David Lamparter 1c6f50bf2d *: snmp: add a load of "static" specifiers
Make it easier to see which bits in *_snmp.c are actually referenced
from non-SNMP parts of the code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-07-28 07:27:47 -04:00
David Lamparter d11f748b30 *: fixup snmp support
- HAVE_POLL is overloaded by net-snmp
- missing includes
- ospf6_snmp converted to vrf_iflist()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-07-24 03:47:03 -04:00
David Lamparter 1cc5e6822b *: add missing includes
Some places, particularly headers, were spewing warnings since they
don't include neccessary other headers to get struct/enum definitions.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 388f8857eb81ef75014060976776523a58a99389)
2016-06-07 08:50:09 -04:00
David Lamparter d8adbe0983 ospf6d: fix uninitialized warning in SNMP
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit a4065069e6bdd0bc7475312530b0e9457f818e0d)
2016-05-26 15:33:32 +00:00
David Lamparter 7e6350359a snmp: fix warnings
batch-fix all warnings that come up when enabling AgentX SNMP support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit dfee58f1d41a2e36c7f5f38a3ef5712224131824)
2016-05-26 15:33:29 +00:00
Vincent Bernat fd5006896f ospf6d: add "auto-cost reference-bandwidth" command
This command allows the user to change to default reference bandwidth
for cost calculations. The default value is 100 Mbps. With a default
bandwidth of 10 MBps, the default cost becomes 10. Those values are
consistent with OSPFv2.

[DL: resolved conflicts in vty command additions & docs]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-03-21 06:28:48 +01:00
Remi Gacogne a11e012e86 security: Fix some typos and potential NULL-deref
This patch against the git tree fixes minor typos, some of them possibily
leading to NULL-pointer dereference in rare conditions.

Signed-off-by: Remi Gacogne <rgacogne-github@coredump.fr>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
2014-02-11 10:28:03 +01:00
Vincent Bernat 0402ca4e92 ospf6d: fix segfault when requesting inexistant interfaces or areas 2012-07-10 09:27:57 +02:00
Vincent Bernat bf836661ef ospf6d: add SNMP notifications/traps support
Only implement ospfv3NbrStateChange and ospfv3IfStateChange.
2012-06-25 19:05:17 +02:00
Vincent Bernat c349bb8692 ospf6d: add SNMP support for ospfv3*LsdbTable
This includes:
 - ospfv3AsLsdbTable
 - ospfv3AreaLsdbTable
 - ospfv3LinkLsdbTable
2012-06-25 19:05:17 +02:00
Vincent Bernat 3bc4f84efe ospf6d: add SNMP implementation of ospfv3IfTable 2012-06-25 19:05:17 +02:00
Vincent Bernat ea86e4042b ospf6d: complete SNMP implementation of ospfv3AreaTable 2012-06-25 19:05:17 +02:00