Commit Graph

216 Commits

Author SHA1 Message Date
David Lamparter
6bb30c2cba *: use frr_elevate_privs() (2/2: manual)
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-14 20:02:05 +00:00
David Lamparter
01b9e3fd0d *: use frr_elevate_privs() (1/2: coccinelle)
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-14 20:02:05 +00:00
Quentin Young
09c866e34d *: rename ferr_zlog -> flog_err_sys
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
85cd2f9f9a *: rename ferr_ref -> log_ref
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
5ad4c39ce4 *: stop double initialization of ferr
* Stop double init of ferr
* Fixup bugs in zebra ferr
* Add missing init in ospfd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
247dcce2b5 *: fix source file headers & includes for errcodes
* Use the correct license header
* Stop headers from including themselves
* Use uniform relative include conventions
* Ensure that sources include what they use
* Turn off clang-format around struct array blocks

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
8b0a80f120 eigrpd: Add EIGRP_ERR_XXX for zlog_err to zlog_ferr
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
6ae7ed45ff eigrpd: Convert to use LIB_ERR_XXX for zlog_err
Convert, where appropriate, to using LIB_ERR_XXX for zlog_ferr

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
cab3de7e27
Merge pull request #2603 from pacovn/PVS-Studio_format_warnings
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
2018-07-02 14:15:43 -04:00
F. Aragon
0651460e00
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 17:50:21 +02:00
F. Aragon
885c8244cf
eigrpd: sizeof() usage + dead code (PVS-Studio)
Two issues:

1) Removed an unnecesary null check of 'ei'
2) Fixed the usage of sizeof(), as it was used the size of a pointer instead
   of the size of the structure

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 16:44:46 +02:00
paco
a2d7fdfeb0
eigrpd ospfd: null chk (Coverity 1458168 1455335)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-25 16:37:04 +02:00
paco
0bf75bd5c9
eigrpd: null check (Coverity 1455334 and 4 alike)
Coverity issues fixed with this commit:

1455334 1455335 1455336 1455337 1455339

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-21 14:02:33 +02:00
Russ White
5e51ae9816
Merge pull request #2491 from pacovn/cppcheck_no_effect
eigrpd, isisd, lib, ospfd: no effect (cppcheck)
2018-06-19 07:15:07 -04:00
paco
6d10727ac1
eigrpd, lib, tests, vtysh: security (cppcheck)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 10:40:56 +02:00
paco
5f18adf01b
eigrpd, isisd, lib, ospfd: no effect (cppcheck)
Assignment of function parameter has no effect outside the function.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 10:19:05 +02:00
Donald Sharp
e8609f7950
Merge pull request #2484 from pacovn/cppcheck_unused_vars
eigrpd, lib: unused vars (cppcheck)
2018-06-18 15:27:11 -04:00
paco
d11c6941dc
babeld, eigrpd, ospfd: unsigned negative check
After Cppcheck 1.72 feedback

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-18 19:07:24 +02:00
paco
029a775e43
eigrpd, lib, vtysh: unused vars (cppcheck)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-18 17:23:38 +02:00
paco
939a62a54d
eigrpd: null return value check (Coverity 1455338)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-12 15:39:30 +02:00
Donald Sharp
1c96f2fb96
Merge pull request #2169 from piotrjurkiewicz/eigrp_feasibility
eigrpd: Consider only feasible successors as successors
2018-05-03 23:02:36 -04:00
Piotr Jurkiewicz
53765081f9 eigrpd: Consider only feasible successors as successors
Meeting the feasibility condition is required also for routes
meeting the variance condition.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2018-05-04 03:01:29 +02:00
Piotr Jurkiewicz
9378632f04 eigrpd: Use EIGRP_PACKET_MTU(mtu) macro
Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2018-05-04 02:58:31 +02:00
Piotr Jurkiewicz
ca83a1ab22 eigrpd: Correctly calculate EIGRP packet MTU
Someone forgot that EIGRP packets are encapsulated in IP.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2018-05-04 02:58:18 +02:00
Quentin Young
1aa37b4810 eigrpd: remove unnecessary assignment
Plot thickens, EIGRP SNMP code was copied from ospfd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-17 13:58:24 -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
Donald Sharp
28b11f8106 *: Modify notify_owner to route_notify_owner
In the future we are going to have a rule_notify_owner
so make the distinction between the two types of notification
clearer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 14:45:57 -05:00
Donald Sharp
28610f7e44 *: Add tableid the route entry was sent to
Add for the southbound pass back the route entries tableid
used for installation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 14:45:57 -05:00
Donald Sharp
4a7371e9e2 *: Track vrfs per nexthop not per route entry
Track the vfrs on a per nexthop basis instead
of on a per route entry basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 19:35:53 -05:00
Donald Sharp
d5b2119cb4 *: Send/receive the nexthop vrf_id
Modify the code to send and receive to/from zebra
the nexthops vrf_id.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:22:07 -05:00
Donald Sharp
2fd89ed7fc eigrpd: Fixup some SA issues
1) strlen(buf) on an uninted value is the wrong thing to do
we should be getting sizeof(buf)

2) tlv is not freed in this error case, so let's free it up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-11 08:42:51 -05:00
Quentin Young
2d34fb80b8
*: don't use deprecated stream.h macros
Some of the deprecated stream.h macros see such little use that we may
as well just remove them and use the non-deprecated macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-01 13:51:06 -05:00
Donald Sharp
ca890872db eigrpd: Start conversion to use route install failure callback
EIGRP must not advertise routes that have failed to install.
This commit turns on the notification for EIGRP.  We still
need to start handling this correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:09:36 -05:00
Donald Sharp
e1a1880de3 *: Make zapi route install Notifications optional
Allow the higher level protocol to specify if it would
like to receive notifications about it's routes that
it has installed.

I've purposely made it part of zclient_new_notify because
we need to track the routes on a per daemon basis only.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:09:35 -05:00
Donald Sharp
c3d4dea255 eigrpd: Allow query send to send more than 1 packet
When we send a query if we have more queries than we
can fit in one packet, allow the packet to be broken
up into multiple packets to be sent to our neighbor.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-02 08:14:34 -04:00
Donald Sharp
03161b7380 eigrpd: Create consts for TLV size
1) Create #defines for TLV SIZE and use them
2) Speed up prefix length by using a switch statement

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-02 08:10:05 -04:00
Donald Sharp
d4395853e8 eigrpd: When writing packet don't crash in some cases
When we are writing a packet if we have gotten ourselves
into a bad situation, note it and move on.  Hopefully
dumping enough information so that we can find the offending
reason.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-29 09:48:02 -04:00
Donald Sharp
b42a4a099a eigrpd: Fix crash in reply receive packet.
When we receive a reply for a prefix we no longer
have we should note the issue and move on instead
of crashing eigrp.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-29 08:28:01 -04:00
Donald Sharp
68b7dd07d5 eigrpd: Query Send is not incrementing the sequence number
When we send a query make sure we increment the query
sequence number.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-29 08:27:08 -04:00
Donald Sharp
052fe05405 eigrpd: On shutdown, delete list after we've cleared prefixes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-28 18:56:34 -04:00
Donald Sharp
377f30c31f eigrpd: Fix an issue found with metric change
A past commit modified the change value to an enum
but did not bother to fix all the places where
change was used.  Fix this.

Additionally add some more output to the fsm prefix
string about the change.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-28 18:45:08 -04:00
Donald Sharp
895722db4e eigrpd: Add ability to show packet type in log
Allow us to examine the packet type that caused us to change
state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-28 18:35:56 -04:00
Donald Sharp
94ccb30979 eigrpd: Create enum for states and string name for display
Create an enum for the different states and create
a string name display handler.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-28 18:06:28 -04:00
Donald Sharp
5cc74ec1b8 eigrpd: Create a function to return a string of prefix state
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-28 18:05:33 -04:00
Renato Westphal
cbb65f5ef5 *: fix coverity warnings - error handling issues
Ignore the return value of some functions in the places we know they
can't fail, and other small fixes.

Regarding the change in bgpd/rfapi/rfapi_rib.c, asserting that
rfapiRaddr2Qprefix() didn't fail is the common idiom inside the rfapi
code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Renato Westphal
efd7904eab *: add missing \n in some help strings
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Donald Sharp
9ca66cc76d eigrpd: Convert topology list to a table
The EIGRP topology list is an extremely inefficient
way to store data about the known routes.  Convert
to using a table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.com>
2017-10-24 08:36:15 -04:00
Donald Sharp
342213eac0 *: Modify zclient_init to require privs data
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:12:29 -04:00