Commit graph

3607 commits

Author SHA1 Message Date
Maria Matejka
258be56539 Nest: Added const to ea_show just to declare that this shouldn't really change anything 2020-05-01 15:19:12 +02:00
Maria Matejka
a7d9b8f116 OSPF: Zero-initialization of a temporary neighbor 2020-05-01 15:19:12 +02:00
Maria Matejka
0fa8bf91cd Nest: Several assumptions to tame the static analyzer 2020-05-01 15:19:12 +02:00
Maria Matejka
bbe49ae569 Nest: Assumption in rt-show for not-so-intuitive invariant. 2020-05-01 15:19:12 +02:00
Maria Matejka
a08853a269 Static scanner and expensive debugging setup fix 2020-05-01 15:19:12 +02:00
Maria Matejka
5f60d14ede RPKI: fixed rare va_list leak 2020-05-01 15:19:12 +02:00
Maria Matejka
b748220906 Static check: Don't report dead code 2020-05-01 15:19:12 +02:00
Maria Matejka
9e64ac4b7c OSPF: Adding a note about a static analyzer result. 2020-05-01 15:19:12 +02:00
Maria Matejka
dccee40826 OSPF: variable-length array of size 0 replaced by alloca()'d pointer
NULL pointer is safer than a random pointer onto stack if this function
gets changed and eventually broken.
2020-05-01 15:19:12 +02:00
Maria Matejka
baac700906 List expensive check. 2020-05-01 15:19:12 +02:00
Maria Matejka
a0d0a71a18 Expensive check declaration
Intended to be run at every operation with complex data structures
to check their consistency and validity.
2020-05-01 15:19:12 +02:00
Maria Matejka
a1b61a271a IPv6 address parser: fail on incomplete addresses 2020-05-01 15:19:12 +02:00
Maria Matejka
d65a926a67 Filter: Don't alloc varargs array if its length would be zero 2020-05-01 15:19:12 +02:00
Maria Matejka
30ba7c1661 Filter: Removed forgotten dead code 2020-05-01 15:19:12 +02:00
Maria Matejka
bf9486bf20 Non-null function argument declaration 2020-05-01 15:18:48 +02:00
Maria Matejka
8029ae527e More assertion categories 2020-04-28 16:21:06 +02:00
Maria Matejka
d607205486 Not calling memcpy with n=0. 2020-04-28 16:21:06 +02:00
Maria Matejka
124d860f64 Filter: fixed omitted overflow check in EC constructor 2020-04-28 16:21:06 +02:00
Maria Matejka
59a86cbc7c Makefile rule for static analyzer 2020-04-28 16:21:06 +02:00
Ondrej Zajicek (work)
3c838ad9fd Tests: Activate BGP test 2020-04-22 17:14:02 +02:00
Nasato Goto
a6548d5b5b BGP: Fix handling of 16bit-only ASN translation
The bug generated invalid AGGREGATOR attribute during translation of
32bit ASN to 16bit-only BGP peer. The patch fixes that.
2020-04-15 03:46:53 +02:00
Maria Matejka
fd9f0c0640 Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
2020-04-09 15:37:14 +02:00
Ondrej Zajicek (work)
a109056145 Doc: Update prefix set comment 2020-04-08 13:11:51 +02:00
Maria Matejka
2928c5bcc7 Fletcher16 test fixed to work at bigendian architectures.
To be honest, it was wrong in concept, anyway it accidentally worked.
2020-04-05 01:15:26 +02:00
Ondrej Zajicek (work)
c9d11e6230 Filter: Remove mixed address tests and fix formatting 2020-03-26 04:59:15 +01:00
Ondrej Zajicek (work)
2755002890 Filter: Optimize IPv4 prefix sets
Use separate IPv4 and IPv6 implementation of prefix sets. Just this
change makes IPv4 prefix sets 60% smaller and 50% faster.
2020-03-26 03:57:48 +01:00
Ondrej Zajicek (work)
d516c68ad8 RIP: Improvements to demand circuit mode
Restart iface after changing demand circuit mode during reconfiguration.
Fix next_regular interval reset during reconfiguration. Send flushing
response when iface goes down.
2020-03-14 17:04:49 +01:00
Maria Matejka
dc042d87cb Perf: changed route update pattern to be more like common protocols 2020-03-12 09:26:05 +01:00
Ondrej Zajicek (work)
e2630a494e Netlink: Handle interfaces with missing broadcast addresses 2020-03-07 05:11:21 +01:00
Ondrej Zajicek (work)
1ad98965c5 Tests: Enforce cleanup before running a test 2020-03-05 22:01:30 +01:00
Ondrej Zajicek (work)
ead531ffef Tests: Activate OSPF tests 2020-03-05 17:39:52 +01:00
Ondrej Zajicek (work)
e6746da6de Flowspec: Fix tests
Missing dst no longer generates error.
2020-03-03 19:04:33 +01:00
Ondrej Zajicek (work)
78e4a123bb BGP: Handle flowspec rules without dst part
The RFC 5575 does not explicitly reject flowspec rules without dst part,
it just requires dst part in validation procedure for feasibility, which
we do not implement anyway. Thus flow without dst prefix is syntactically
valid, but unfeasible (if feasibilty testing is done).

Thanks to Alex D. for the bugreport.
2020-03-03 17:45:16 +01:00
Ondrej Zajicek (work)
757cab18d6 BGP: Support for MD5SIG together with remote range
When dynamic BGP with remote range is configured, MD5SIG needs to use
newer socket option (TCP_MD5SIG_EXT) to specify remote addres range for
listening socket.

Thanks to Adam Kułagowski for the suggestion.
2020-02-27 17:29:17 +01:00
Ondrej Zajicek (work)
22c3cf955d RIP: Demand circuit support (RFC 2091) 2020-02-21 02:35:50 +01:00
Ondrej Zajicek (work)
3343088a71 RIP: Fix crash when interface is removed
Recent changes in neighbor code caused RIP to access neighbor field which
is NULL during interface/neighbor removal and caused crash when debug
messages are enabled. Use correct field to get iface from neighbor.
2020-02-14 22:43:27 +01:00
Maria Matejka
ab089f4fb5 Conf: Better error message when reading iproute2 config
Reported by: Martin Weinelt <martin@darmstadt.freifunk.net>
2020-02-04 10:34:46 +01:00
Maria Matejka
027a3e66f7 RPKI: Allow build without libSSH 2020-02-04 10:15:35 +01:00
Maria Matejka
4bbc10614f Added missing extern
Thanks to Robert Scheck <bird@robert-scheck.de> who reported it
and Toke Høiland-Jørgensen <toke@toke.dk> who suggested this patch.
2020-02-04 10:11:16 +01:00
Ondrej Zajicek (work)
7f9adafc10 BFD: Option to specify which class of BFD sessions are accepted
Allows to configure IPv4/IPv6-only or direct/multihop-only BFD protocol
instances.
2020-01-28 18:07:25 +01:00
Ondrej Zajicek (work)
9f2670277c OSPF: Fix bad initialization of tx_hdrlen field
Function ifa_tx_hdrlen() uses fields autype and passwords, so it must be
called after these are set.

Thanks to Kenth Eriksson for the bugreport.
2020-01-09 03:02:15 +01:00
Ondrej Zajicek (work)
7d767c5a3d KRT: Improve syncer code to avoid using temporary data in rtable
The old code stored route verdicts and temporary routes directly in
rtable. The new code do not store received routes (it immediately
compares them with exported routes and resolves conflicts) and uses
internal bitmap to keep track of which routes were received and which
needs to be reinstalled.

By not putting 'invalid' temporary routes to rtable, we keep rtable
in consistent state, therefore scan no longer needs to be atomic
operation and could be splitted to multiple events.
2020-01-07 18:35:03 +01:00
Ondrej Zajicek (work)
ef8c45749c Filter: Fix typecheck for AND/OR.
Do not apply dynamic type check for second argument of AND/OR, as it is
not evaluated immediately like regular argument would be.

Thanks to Mikael for the bugreport.
2020-01-07 01:24:30 +01:00
Ondrej Zajicek (work)
cc75b3e1dc KRT: Remove KRF_SYNC_ERROR flag
This info is now stored in an internal bmap. Unfortunately, net.flags
is still needed for temporary kernel data.
2019-12-19 16:34:35 +01:00
Ondrej Zajicek (work)
90a9c97e38 KRT: Fix removal of KRF_INSTALLED
Use route id from net->routes to check export_map. Route received from
sysdep KRT code does not have proper id.
2019-12-17 16:30:29 +01:00
Ondrej Zajicek (work)
3dabf7b8d0 Test: Improve filter_test
Initial parsing of test.conf must be done directly in filter_test main,
while reconfiguration is handled as a regular test. Also fix several
minor issues in test code.
2019-12-17 00:01:53 +01:00
Ondrej Zajicek (work)
3232d17186 Doc: Fix documentation of BGP gateway option
Thanks to Nico Schottelius for the bugreport.
2019-12-16 18:08:40 +01:00
Ondrej Zajicek (work)
c132acae36 KRT: Remove KRF_INSTALLED flag
The same information is stored in export_map of kernel protocol.
2019-12-16 02:42:24 +01:00
Maria Matejka
d3aa4f2aed Filter: fix filter comparison test 2019-12-12 15:42:46 +01:00
Ondrej Zajicek (work)
dfb3eb7716 Filter: Fix function comparison
Check the SYM_FLAG_SAME in new symbols. The old code checked that
in old symbols (f2).
2019-12-10 18:53:16 +01:00