Commit Graph

174 Commits

Author SHA1 Message Date
rgirada
960417cf06 ospfd: OSPF external summarisation scenarios
Description:
	Aggergation handled in the following scenarios.
	1. Route update from Zebra.
	2. Refresh external LSA.
	3. Processing routemap update.
	4. Self originated lsa processing.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:34:11 -08:00
rgirada
63f0e9415c ospfd: ospf summarisation core handlers
Description:
Apis for creating/deleting aggregate routes.
Origination of summary route on behalf of matched external routes.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 21:17:26 -08:00
Olivier Dugeon
0ab14b484c
Merge pull request #7341 from kssoman/nssa_fix
ospfd: External LSA not flushed when area is configured as NSSA
2020-10-27 15:30:31 +01:00
Soman K S
44445dee9a ospfd: External LSA not flushed when area is configured as nssa or stub
Issue:
When the ospf area is changed from default to nssa or stub, the previously
advertised external LSAs are not removed from the neighbor.
The LSAs remain in database till maxage timeout.

Fix:
Advertise the external LSAs with age set to maxage and flood to the
nssa or stub area.

Signed-off-by: kssoman <somanks@gmail.com>
2020-10-24 18:05:40 +05:30
Mark Stapp
96b663a381 ospfd: replace inet_ntoa
Stop using inet_ntoa, use %pI4 etc or inet_ntop instead

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22 13:37:25 -04:00
Donald Sharp
ae32e1c298 ospfd: Convert to using %pFX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-17 13:39:10 -04:00
rgirada
df074ec33a ospfd: GR helper exit scenarios
Description:
	The follwoing helper exit scenarios are handled.
	1. Recv Max age grace LSA from RESTARTER.
	2. Grace timer expiry.
	3. Due to topo change if lsa check is enabled.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-09-22 00:02:37 -07:00
ckishimo
919714bd3f ospfd: fix debug ospf nssa prints wrong info
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-09-15 17:38:33 +02:00
Donald Sharp
3eb15671ee
Merge pull request #6731 from opensourcerouting/style-string-prep
*: string coding style
2020-07-15 20:06:55 -04: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
Santosh P K
1febb13de7 ospf: Default-information originate with routemap
Default originate with route-map was broken. Routemap
was not getting applied for redistribute route but was
getting applied default route itself. No default route
was originated even when routemap was satisfied.

Signed-off-by: Santosh P K <sapk@vmware.com>
2020-07-07 04:53:14 -07:00
David Lamparter
c334a16ef1
Merge pull request #6262 from qlyoung/remove-sprintf 2020-04-23 20:27:26 +02:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Rafael Zalamena
5920b3eb38 *: replace all random() calls
Replace all `random()` calls with a function called `frr_weak_random()`
and make it clear that it is only supposed to be used for weak random
applications.

Use the annotation described by the Coverity Scan documentation to
ignore `random()` call warnings.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17 20:57:43 -03:00
Donatas Abraitis
c4efd0f423 *: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-08 17:15:06 +03:00
David Lamparter
63efca0e95 *: remove line breaks from log messages
Line break at the end of the message is implicit for zlog_* and flog_*,
don't put it in the string.  Mid-message line breaks are currently
unsupported.  (LF is "end of message" in syslog.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-03-24 19:43:18 +01: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
15569c58f8 *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05 20:23:23 +02:00
Donatas Abraitis
975a328e2e *: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06 09:00:12 +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
Donald Sharp
f573ec607c ospfd: Remove ORIGINAL_CODING check
We have a bunch of places that look for ORIGINAL_CODING.  There is
nothing in our configure system to define this value and a quick
git blame shows this code as being original to the import a very
very long time ago.  This is dead code, removing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00
Quentin Young
c258527bd2 *: strip trailing whitespace
Some of it has snuck by CI

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-30 16:44:43 +00:00
David Lamparter
d5eac1e0ca ospfd: clean up default route logic
What a mess...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-02 11:29:03 +02:00
David Lamparter
f1cf5af6da ospfd: don't ASE with router-ID 0
The ASEs will be generated later by ospf_external_lsa_rid_change().

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-02 11:29:03 +02:00
David Lamparter
e410fd7f29 Revert "ospfd: remove default origin max age lsa"
This reverts commit 313919d6e3.

This is not the correct way to fix this.

- touching the LSDB to explicitly remove a MaxAge LSA is always wrong
  and results in desynchronization of the entire routing domain
- the LSDB code correctly handles replacing a MaxAge LSA with a newly
  issued one
- removing the old LSA resets the sequence numbers, which may cause
  other routers to reject the new LSA as old
- the function was horribly misnamed

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-02 11:29:03 +02:00
David Lamparter
fa3c7c7e95 ospfd: kill totally misnamed "timers"
Neither ospf_external_lsa_originate_timer() nor
ospf_default_originate_timer() are actually timers.  They're only
executed on router-ID changes to refresh a particular LSA type.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-02 11:29:03 +02:00
David Lamparter
e8a2cc5323 ospfd: remove t_external_lsa
It's unused...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-02 11:29:03 +02:00
David Lamparter
a61b32f00d ospfd: fix clang-SA warning
Need to clear refresh_list before dropping the reference.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-04-17 13:28:49 +02:00
Quentin Young
236e900ca4 ospfd: fix behavior of +/-metric
OSPFD uses -1 as a sentinel value for uninitialized metrics. When
applying a route map with a +/-metric to redistributed routes, we were
using -1 as our base value to increment or decrement on, which meant
that if you set e.g. +10, you would end up with a redistributed route of
metric 9.

This patch also removes an off-by-one sanity check that would cause a
set metric +1 or set metric 0 to result in a metric value of 20 :-)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-08 17:05:45 +00:00
Ruben Kerkhof
4d762f2607 Treewide: use ANSI function definitions
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-01-24 11:21:59 +01:00
Chirag Shah
313919d6e3 ospfd: remove default origin max age lsa
default-information originate does not work
if config is removed and re-added.

Ticket:CM-20026
Testing Done:
Validate default-information originate config
removed and re-added, check ospf lsa database, and peer
route cache entry for default route.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-15 21:06:58 -08: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
F. Aragon
a3904dd340
ospfd: dead code (Coverity 1302499)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-10-01 12:03:15 +02:00
F. Aragon
74d638d522
ospfd: dead code (Coverity 1472227)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-26 17:25:42 +02:00
Quentin Young
cf444bcf40 ospfd: OSPF_[ERR|WARN] -> EC_OSPF
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 18:56:04 +00:00
Donald Sharp
13ab4921b1 ospfd: Convert ospf_lsa.c to use new error-card Syntax
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06 20:50:58 +00:00
Donald Sharp
542a208f3a ospfd: Add OSPF_WARN_LSA_INSTALL_FAILURE error code
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06 20:50:58 +00:00
Donald Sharp
266469ebab ospfd: Cleanup some warnings that were not warnings
1) stream allocation cannot fail
2) some warnings were removed when functions safely ignored
the calling parameters being wrong.
3) some warnings were removed when functions did not consider
the state as an error since we did not return an error code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06 20:50:58 +00:00
Donald Sharp
db3c830afe isisd, ospfd, tests: Switch to using stream_resize_inplace
Switch code and tests to use new stream_resize_inplace functionality.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-22 07:58:54 -04:00
Donald Sharp
5b3d4186de ospfd: Add ospf_lsa_new_and_data function and abstract away
In all but one instance we were following this pattern
with ospf_lsa_new:

ospf_lsa_new()
ospf_lsa_data_new()

so let's create a ospf_lsa_new_and_data to abstract
this bit of fun and cleanup all the places where
it assumes these function calls can fail.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-20 20:41:37 -04: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
F. Aragon
84542f3903
ospfd: dead code (Coverity 1472227)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-03 15:51:05 +02:00
F. Aragon
b575a12c87
bgpd lib ospfd pimd ripngd: null chk (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-03 15:39:50 +02:00
paco
a37befa70b
ospfd: dereference check (Clang scan-build)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 15:49:36 +02:00
Quentin Young
12a81f8eb1 ospfd: set external_info instance value to 0
This value is used but never set. Set it to zero to suppress static
analysis errors.

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
Donald Sharp
044506e7f8 ospfd: LSDB_LOOP treat it as a loop.
Inform the .clang-format file about LSDB_LOOP and
put the proper indentation for this loop into the
code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-17 13:29:58 -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
Svata Dedic
493472ba8e ospfd: fix NSSA LSA translation (BZ#493) (BZ#250) 2017-12-01 10:08:36 -05:00