0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-27 12:11:53 +00:00
Commit Graph

3270 Commits

Author SHA1 Message Date
Maria Matejka
14d6f6d75c OSPF: Zero-initialization of a temporary neighbor 2019-08-17 13:53:52 +02:00
Maria Matejka
4f81a9035a Nest: Several assumptions to tame the static analyzer 2019-08-17 13:53:50 +02:00
Maria Matejka
ad33995536 Nest: Assumption in rt-show for not-so-intuitive invariant. 2019-08-17 13:51:32 +02:00
Maria Matejka
c576a7e4af Static scanner and expensive debugging setup fix 2019-08-17 13:51:09 +02:00
Maria Matejka
fcc62d55e7 RPKI: fixed rare va_list leak 2019-08-17 13:50:48 +02:00
Maria Matejka
64bad8e71b Static check: Don't report dead code 2019-08-17 13:50:40 +02:00
Maria Matejka
3cbe3255aa OSPF: Adding a note about a static analyzer result. 2019-08-17 13:49:19 +02:00
Maria Matejka
051f258cad 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.
2019-08-17 13:49:10 +02:00
Maria Matejka
05b8620a81 List expensive check. 2019-08-17 13:49:04 +02:00
Maria Matejka
2e6bc86beb Expensive check declaration
Intended to be run at every operation with complex data structures
to check their consistency and validity.
2019-08-17 13:48:55 +02:00
Maria Matejka
a4ee61b66d IPv6 address parser: fail on incomplete addresses 2019-08-17 13:47:31 +02:00
Maria Matejka
763c124ef8 Filter/Trie: jump over branches that are never true in first iteration 2019-08-17 13:47:22 +02:00
Maria Matejka
531e0359d7 Not calling memcpy with n=0. 2019-08-17 13:46:30 +02:00
Maria Matejka
1c99f546bb Makefile rule for static analyzer 2019-08-17 13:44:43 +02:00
Ondrej Zajicek (work)
f29478d993 Nest: Fix crash in route reload when some channels are not up.
Only channels that are up can be reloaded.
2019-08-13 19:00:25 +02:00
Ondrej Zajicek (work)
0d1966cc1d BGP: implement Adj-RIB-Out
The patch implements optional internal export table to a channel and
hooks it to BGP so it can be used as Adj-RIB-Out. When enabled, all
exported (post-filtered) routes are stored there. An export table can be
examined using e.g. 'show route export table bgp1.ipv4'.
2019-08-13 18:43:36 +02:00
Ondrej Zajicek (work)
b357f25932 BGP: Improve reconfiguration
Several BGP channel options (including 'next hop self') could be
reconfigured without session reset, with just route refeed/refresh.
The patch improves reconfiguration code to do it that way.
2019-08-05 14:43:49 +02:00
Ondrej Zajicek (work)
6b68390702 BGP: Fix 'deterministic med' to work with 'merge paths'
The 'deterministic med' option is implemented by suppressing other than
best-in-group routes (grouped by ASN) from best route selection. This
interferes with 'merge paths' as supressed routes are no longer mergable
with best route. This is fixed by suppressing only those routes that are
not mergable with best-in-group route.
2019-08-05 00:29:47 +02:00
Ondrej Zajicek (work)
3e389e6786 Nest: Show mergable routes in 'show route' output
Routes mergable with the best route are marked by '+'.
2019-08-03 00:16:49 +02:00
Maria Matejka
b08ca3d958 More assertion categories 2019-08-01 14:25:01 +02:00
Maria Matejka
69f788bbce Log: Fixed race condition in reconfigure while BFD is running 2019-07-30 12:12:44 +02:00
Ondrej Zajicek (work)
36d5d2dd5c OSPF: Fix handling of NSSA option flags
Per RFC 3101, N-bit signalling NSSA support should be used only in Hello
packets, not in DBDES packets. BIRD since 2.0.4 verifies N-bit in
neighbor structure, which is learned from DBDES packets, therefore
NSSA-LSAs are not propagated to proper implementations of RFC 3101.

This patch fixes that. Both removing the check and removing N-bit from
DBDES packet. This will fix compatibility issues with proper
implementations, but causes compatibility issues with BIRD 2.0.4.
2019-07-10 18:48:50 +02:00
Ondrej Zajicek (work)
e8951ef5de OSPF: Update DR when local priority changes
When priority is reconfigured locally, we need to trigger DR election.
2019-07-10 18:40:15 +02:00
Ondrej Zajicek (work)
d0e4ba4a31 OSPF: Minor fix in graceful restart
Most LSA origination is blocked in ospf_update_topology(), this fix
blocks LSA origination from ospf_rt_spf().
2019-07-10 18:39:42 +02:00
Ondrej Zajicek (work)
b0eff444e2 OSPF: Fix handling of external routes on graceful restart
We need to flush learned external LSAs a bit later than other LSAs (after
first feed after end of the graceful restart) to avoid flap of external
routes.
2019-07-10 18:38:43 +02:00
Ondrej Zajicek (work)
a15749dd7a Add mock-up function for unit tests
They failed without it.
2019-06-30 22:59:57 +02:00
Ondrej Zajicek (work)
92f561b30f Add mock-up function for unit tests
They failed without it.
2019-06-30 22:31:31 +02:00
Ondrej Zajicek (work)
8bd2976780 Doc: OSPF graceful restart options 2019-06-30 22:26:43 +02:00
Ondrej Zajicek (work)
fc0eaaffed OSPF: Support for graceful restart
Implement OSPFv2 (RFC 3623) and OSPFv3 (RFC 5187) graceful restart,
for both restarting and helper sides. Graceful restart is initiated
by 'graceful down' command.
2019-06-30 22:23:57 +02:00
Ondrej Zajicek (work)
0e1c3c3494 Nest: Add command to request graceful restart
When 'graceful down' command is entered, protocols are shut down
with regard to graceful restart. Namely Kernel protocol does
not remove routes and BGP protocol does not send notification,
just closes the connection.
2019-06-30 22:15:24 +02:00
Ondrej Zajicek (work)
3d23e41dcb Nest: Use rtable for neighbor lookup
Implicitly define rtables 'local4' and 'local6' and a pair of direct
protocols to fill them. Use modified net_route() for neighbor
lookup to avoid iterating over all interfaces.
2019-05-31 21:23:32 +02:00
Ondrej Zajicek (work)
7d1c2ea5c0 Nest: Use bitmask of pxlens to speed-up net_route()
Use bitmask to keep track of pxlens that might be in rtable to avoid
unnecessary lookups during net_route().
2019-05-28 17:23:32 +02:00
Ondrej Zajicek (work)
5c73cd94a5 Nest: Add hash table for interfaces, keyed by index
Useful if one have too many interfaces, as there are per-route
iface index lookups in routing table scan.
2019-05-14 19:01:44 +02:00
Ondrej Zajicek (work)
e092341df3 Nest: Handle unresolvable routes as invalid
Handle unresolvable routes (recursive routes that cannot be resolved) as
invalid, i.e. deprioritize tham and do not allow them for propagation.
Such route now shows as 'unresolvable' instead of 'unreachable'.
2019-05-10 15:02:21 +02:00
Ondrej Zajicek (work)
3cd20658e2 OSPF: Do not use igp_metric as default for OSPF metric 2019-04-21 13:12:07 +02:00
Ondrej Zajicek (work)
9b73157ea1 BGP: Handle case where capabilites are not used
If peer does not announce capabilities at all, or when we have
capabilities disabled, handle that as implicit IPv4 unicast.
2019-03-15 20:57:26 +01:00
Ondrej Zajicek (work)
37dbd3fc7a Static: Allow to set multiple static route with different metric
Change the usage of preference to distinguish multiple static routes to a
separate metric attribute, Reuse igp_metric attribute for that purpose.

The static route metric is specified with 'metric' keyword immediately
after the network (to signify it is a part of key):

  route 10.10.0.0/24 metric 10 via 192.168.1.2;
2019-03-14 14:44:35 +01:00
Ondrej Zajicek (work)
fc50b2196b Nest: Fix handling of ECMP next hop flags
Flag field was not copied when next hop was cached.
2019-02-17 23:03:41 +01:00
Ondrej Zajicek (work)
ed97d77073 OSPF: Reset LSAs during area type change
When area is reconfigured to a different type, we need to flush LSAs as
they may not be valid (e.g. NSSA-LSA for non-NSSA area). Also, when we
have have just one OSPF area and that changes type, we could restart OSPF
as there is no state to keep anyway. That solves issue with different
handling of external routes exported to OSPF based of main area type.
2019-02-17 23:02:06 +01:00
Ondrej Zajicek (work)
cb8ea2d907 OSPF: Basic support for DN-bit handling (RFC 4576)
External LSAs originated by OSPF routers with VPN-PE behavior enabled are
marked by DN flag and they are ignored by other OSPF routers with VPN-PE
enabled.
2019-02-17 23:02:05 +01:00
Ondrej Zajicek (work)
85646cd46a Nest: Report preferred counters also when 'import keep filtered' is enabled
Thanks to Michal Nowak for reporting the issue.
2019-02-17 23:02:05 +01:00
Ondrej Zajicek (work)
a30b9d2800 OSPF: Opaque LSAs and Router Information LSA
Add support for OSPFv2 Opaque LSAs (RFC 5250) and for Router Information
LSA (RFC 7770). The second part is here mainly for testing opaque LSAs.
2019-02-17 23:02:05 +01:00
Ondrej Zajicek (work)
45426652a2 OSPF: Fix wrong LSA collisions detection
In some circumstances (old LSA flushed but not acknowledged and not
removed) origination of a new LSA may wrongly triggers LSA collision
code. The patch fixes that.

Thanks to Asbjorn Mikkelsen for the bugreport and @mdelagueronniere
for the original patch.
2019-02-17 23:02:05 +01:00
Ondrej Zajicek (work)
210dbc16c2 BGP: implement Adj-RIB-In
The patch implements optional internal import table to a channel and
hooks it to BGP so it can be used as Adj-RIB-In. When enabled, all
received (pre-filtered) routes are stored there and import filters can
be re-evaluated without explicit route refresh. An import table can be
examined using e.g. 'show route import table bgp1.ipv4'.
2019-02-17 23:02:05 +01:00
Ondrej Zajicek (work)
1e5dcb37ac OSPF: Send direct acknowledgements as unicast
Direct acknowledgements should be send as unicast to a corresponding
neighbor. Only delayed acks should be send as multicast to all/designated
routers.
2019-02-03 21:31:53 +01:00
Ondrej Zajicek (work)
99b2d10be0 OSPF: Reject duplicate DBDES packets after dead interval
Master may free last DBDES packet immediately. Slave must wait dead
interval before freeing last DBDES packet and then reject duplicate
DBDES packets with SeqNumberMismatch.
2019-02-03 21:31:15 +01:00
Ondrej Zajicek (work)
bf402c61e6 OSPF: DD seqnum should be initialized only for first attempts
After SeqNumberMismatch/BadLSReq, we should continue with the old
seqnum++. The old code tries to do that by n->adj, but it was set
nowhere.
2019-02-03 21:30:10 +01:00
Ondrej Zajicek (work)
2bbd72863f OSPF: Reject DBDES packets with non-matching MTU
As it is specified in RFC 2328. The old code just provided warning.
2019-02-03 21:27:02 +01:00
Ondrej Zajicek (work)
ccee5a863e BGP: Cleanup channels when going down
When going up, uncleaned old channel state may trigger unexpected
conditions crashing bird.
2019-01-28 15:23:54 +01:00
Maria Matejka
2ba6a02395 Nest: fixed corner cases on deleting from fib 2019-01-17 10:40:45 +01:00