Commit graph

53 commits

Author SHA1 Message Date
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
Vincent Bernat 2c5f148065 ospf6d: complete SNMP implementation for scalar objects 2012-06-25 19:05:16 +02:00
Vincent Bernat 061bc735b4 ospf6d: add SNMP support for ospfv3NbrTable 2012-06-25 19:05:16 +02:00
Vincent Bernat 0f0ab51808 snmp: fix OSPFV3-MIB implementation
Use the real MIB from RFC 5643. Fix used ASN1 types. Indexes are not
exported any more (they are "no access"). Fix some endian
issues. Also, ID are just integers, not IPv4 addresses.

No additional OID are supported in this commit.
2012-06-25 19:05:16 +02:00
Vincent Bernat 8046ba6ec4 snmp: let handlers accept OID from a lesser prefix
Most table handlers do not expect to be given an OID whose prefix is
outside what they can handle. This is not a problem with the SMUX
implementation since it always correct the OID such that the prefix
matches. However, this is not the case for the AgentX
implementation. A new function, smux_header_table() is used to do this
normalization.
2012-06-25 19:03:23 +02:00
Vincent Bernat 6b1e37f853 build: only define HAVE_SNMP
NetSNMP is the only SNMP implementation for Quagga. We don't need two
different symbols.
2012-06-25 19:03:23 +02:00
Chris Caputo 0be8dfb2a9 [snmp] Compiler warning fixes for when "--enable-snmp" is configured.
Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms.
No run-time testing on 32-bit and limited run-time testing on 64-bit.
2009-06-02 18:45:10 +01:00
Joakim Tjernlund fb62a3cef5 Make --enable-snmp cross compile and make libcrypto optional with --without-crypto
Autoconfig work by me, the rest was done by
"Kirill K. Smirnov" <lich@math.spbu.ru>
2008-08-25 09:48:30 +02:00
Andrew J. Schorr eda9ba743c [64-bit] Fix 4 problems with printf formats and 64-bit size_t
2007-04-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* lib/smux.c: (smux_trap) Fix printf format to work with 64-bit size_t.
	* ospf6d/ospf6_snmp.c: (ospfv3AreaEntry, ospfv3AreaLsdbEntry) Fix some
	  zlog_debug printf formats to work with 64-bit size_t.
2007-04-27 18:13:15 +00:00
paul 1eb8ef2584 2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
	  and some basic auditing of usage.
	* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
	* HACKING: Add notes about deprecating interfaces and commands.
	* lib/linklist.h: Add usage comments.
	  Rename getdata macro to listgetdata.
	  Rename nextnode to listnextnode and fix its odd behaviour to be
	  less dangerous.
	  Make listgetdata macro assert node is not null, NULL list entries
          should be bug condition.
          ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
          with for loop, Suggested by Jim Carlson of Sun.
          Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
          "safety" of previous macro.
	  LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
	  distinguish from the similarly named functions, and reflect their
	  effect better.
	  Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
	  with the old defines which were modified above,
	  for backwards compatibility - guarded to prevent Quagga using it..
	* lib/linklist.c: fix up for linklist.h changes.
	* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
	  scan of the area list, rather than scanning all areas first for
	  INTER_ROUTER and then again for INTER_NETWORK. According to
	  16.2, the scan should be area specific anyway, and further
	  ospf6d does not seem to implement 16.3 anyway.
2005-04-07 07:30:20 +00:00
hasso c6487d61a9 *.c: Change level of debug messages to LOG_DEBUG. 2004-12-24 06:00:11 +00:00
hasso b3c8c46502 Fix compile. 2004-11-26 12:55:51 +00:00
hasso 2680aa2b2b Merge svn revisions 1208, 1222 and 1228 from Zebra cvs. 2004-11-25 20:54:46 +00:00